0
I need to get just the ID of this line: "21 Julio André 21 Years" Since the ID is at the beginning of the line and is equal to age, the functions I tried to split the strings were Substring() and Split().
Follow the code excerpt below:
String linha = "21 Julio André 21 Anos";
String id = linha.Substring(0, linha.IndexOf(' '));//Captura o valor do ID no começo da linha
Console.WriteLine(id);
String resto = linha.Replace(id, "");
Console.WriteLine(resto);
What returns in the Console:
21
Julio André Anos
But it would be great if you came back:
21
Julio André 21 Anos