Questions tagged as 'string'

2
answers

str_replace using arrays

I want to negate the searched terms in the results, but when I use explode , and I try to use str_replace , I get an array back. <?php $search_term = filter_var( $_GET['s'], FILTER_SANITIZE_STRING ); $palavras = explode( ' ',...
asked by 10.10.2014 / 19:03
1
answer

String Markup and Value Return

Here is my program, I need to register up to 100 products, each product is available in 5 stores and I need to tell the quantity sold of each product in each of the 5 stores. I will have a menu that will have option of registration, media of sal...
asked by 04.10.2018 / 01:48
1
answer

How to concatenate values of different types in a string?

How do I concatenate all this string within a variable? Is there a more elegant way to solve my problem? int num1 = 1; int num2 = 2; int num3 = 3; char simbol1 = '+'; char simbol2 = '-'; string equation = num1 + " " + simbol1 + " ( "...
asked by 26.09.2018 / 21:05
1
answer

Is the null character \ 0 automatically placed at the end of the string or does it not put because I set the scanf limit?

#include <stdio.h> #include <stdlib.h> int main(void) { char nome[20]; char sobrenome[20]; char nomeSobrenome[40]; printf("Insira seu nome e seu sobrenome:\n"); //scanf("%s%s", nome, sobrenome); scanf("%[A-Z...
asked by 03.09.2018 / 22:43
2
answers

Is it possible in PHP to retrieve part of a string using the same notation as Python?

I have the following variable for example: $teste = 'Uma frase qualquer!'; In Python , for me to retrieve the word frase , I would use the notation variavel[inicio:fim] : teste = 'Uma frase qualquer!' print(teste[4:9]) # fras...
asked by 31.03.2018 / 04:11
2
answers

How to read only one line of a file in C #

I know how to read the whole file but how can I read only one line EX: read line 3 only     
asked by 02.04.2018 / 03:32
1
answer

Validate First and Last Name in JavaScript?

I have a form called 'cad' for registration, my only missing validation is the first and last name, the id, 'txtname' and 'txtsname', I need a function that validates them as follows: can only have letters, no symbols, points and numbers, only l...
asked by 19.05.2018 / 06:33
1
answer

Android Studio set a string in several textview

I'm studying Android Studio and I ended up with a problem, and I needed a light. I made several textView on the screen of my application and when I hit a button I would change the contents of all textViews that are on the screen. In case I...
asked by 24.02.2018 / 03:51
1
answer

Error in inversion of a string

I'm trying to invert a string through a function but it is giving error, but I do not know where it is wrong. Just below is my code. #include<stdio.h> #include<stdlib.h> #include <string.h> char troca(char nome[100], c...
asked by 26.12.2017 / 17:30
1
answer

How to transform a text in identifier name?

I would like to be able to receive a string as a parameter and use it as the identifier name, to create a variable or function with that name (not to use as a dictionary key). Is it possible to do this?     
asked by 03.11.2017 / 12:20