Questions tagged as 'string'

2
answers

How to sort and sort strings without using Collection?

I am creating an employee record with some fields (name, email, phone and salary) in ArrayList that are written to txt. After the data is entered into the array (before moving to txt) they need to be sorted by name, which is the first...
asked by 15.11.2015 / 19:22
1
answer

Error comparing two strings

I'm trying to compare two strings , so when I enter a name in my threaded list it can not be inserted if it already exists. I have already used the search_name function to display a searched name and to exclude, but now it is simply giving s...
asked by 05.12.2014 / 20:05
2
answers

Compare strings with accents, UTF-8

Something is escaping me here, I'm doing the curl to a weather page, if the results have accents and comparing with exactly the same string in full this condition returns false (not equal). This is purely for testing: function get_page($url) {...
asked by 30.06.2015 / 17:10
2
answers

Replace in large string or split loop

I have a multidimensional array with some routes and need to convert some elements defined as: (alpha), (int), (id), etc. . As an array, I currently use a loop to do the replace. I thought of approaching another way without the loop, and...
asked by 01.10.2014 / 10:17
2
answers

Print associative array element within string without concatenation

I have to print an tag HTML through a echo with the value of an associative array, but I can not get it to print using concatenation. Code .php (this way it is not working, I believe the quotation marks that surround 'name')...
asked by 25.01.2015 / 13:14
1
answer

Battery Exercise - String with garbage

   Write an algorithm, using a Stack, that inverts the letters of each word of a finished text by period (.) preserving the order   of words. Per   example, given the text: THIS EXERCISE IS VERY EASY. The output should be: ETSE OICICREXE AND OTI...
asked by 18.10.2018 / 03:38
1
answer

What is the difference between "string_view" for "string" and which one should you prefer?

What's the difference between the new C ++ class and 17 string_view for string ? In what situations is the use of string_view indicated instead of string ?     
asked by 22.08.2018 / 20:22
1
answer

Recursion Doubt with String in Java

I'm trying to solve the following exercise:    An S collection of strings is defined recursively by:       'a' and 'b' belong to S;    If X belongs to S, then Xb also belongs to S;    Write a procedure that implements this definition rec...
asked by 25.08.2018 / 17:33
1
answer

Segmentation Fault in function that changes the values of 2 strings

The following function changes (or at least should) the content of two strings void trocar(char *a, char *b){ char *novo = (char *) malloc(sizeof(char) * 10); strcpy(novo, a); strcpy(a, b); strcpy(b, novo); } But when cal...
asked by 19.11.2018 / 05:17
2
answers

How to transform a character into an integer in C? [duplicate]

How to transform a character into an integer? #include <stdio.h> #include <stdlib.h> #include <string.h> int main(void) { char N[11]; int i; scanf("%s",N); int cont = strlen(N); for(i=0; i<cont; i++) {...
asked by 17.08.2018 / 17:18