Questions tagged as 'string'

1
answer

I would like to transform "a" + str (1) into a1 without being a strig, so I can associate a value "a" with str (1) = 2 how do I?

"a"+str(1)=2 File "<ipython-input-44-929460161ba7>", line 1 "a"+str(1)=2 ^    SyntaxError: can not assign to operator I want to create a series of variables a1 a2 a3 an and then associate with a value each     
asked by 15.12.2016 / 17:47
1
answer

strcpy () in struct string

I have a struct Time that has a char name[30] vector, the problem starts when I try to copy a value to this string with the function strcpy() , it follows the code of stuct : typedef struct Time{ char name[30];...
asked by 31.10.2016 / 12:01
1
answer

NMAP result using PHP - how to show the NMAP result in a table in the browser?

I'm trying to make the output of the nmap result appear in the browser in the form of a table. follow the code below: <?php $host = $_POST["host"]; $saida = shell_exec('nmap -P0 ' . $host); $vetorLinhas = explode("\n", $saida); echo "<pr...
asked by 20.11.2016 / 23:55
1
answer

Required field fill

How do I enforce that between two fields, at least one of them is mandatory (is it filled out)? For example, the fields Celular and Telefone can not be saved empty, only one of them. My code: //.. } else ((txtNome.Text == "")...
asked by 30.06.2016 / 23:25
1
answer

Change accented characters to unaccented ones

Is there any kind of method for me to do a replace in characters based on the CASE of the same? I'm looking for something like this: UPDATE foo SET bar = SUBSTRING(bar, "Ã","ã"); -- se o caracter for LOWER -> ã -- se o caracter for UPPER...
asked by 30.08.2016 / 18:45
1
answer

Do you have any way to access a position using a string?

Would not I have some way to access a position using a string ? Example: int vetor[1000000]; vetor["abc"]++; I know it's crazy, but ... "abc" = 01100001, 01100010, 01100011, 00000000 (null character), so "abc" should not represent 1633837...
asked by 07.08.2016 / 23:16
1
answer

How to supply a specific amount of strings to be tested?

I can test whether a user supplied string is a palindrome or not (word or phrase that can be read backwards ignoring spaces and uppercase and lowercase letters, for example: Help me get on the bus in Morocco), using the code: string = raw_inpu...
asked by 28.03.2016 / 23:58
2
answers

Return information from a String

I'm trying to return information from a String. What I need is to pass a String parameter and return the information it has in the indicated places. Eg: String FraseParametro = "<R1> casou com <R2>, e traiu ela com <R3>...
asked by 16.05.2016 / 17:21
3
answers

Doubt regarding pointers in C

void imprime (char *v, int n) { char *c; for (c = v; c < v + n; v++) printf ("%c", *c); } I have this function, but I do not understand what it is doing exactly and how the pointers behave in this case.     
asked by 28.09.2016 / 21:46
1
answer

Space in a String C

I'm starting to learn C, and I came across the following doubt: When I ask the user to inform me a song or artist, he ends up informing me of a song with spaces, type "AS I AM" , but the program skips the part of the song and the artist...
asked by 27.02.2016 / 01:13