Good Afternoon
string nr = ABC:1
I would like to get the number after ":", how would you do it?
nr = nr.substring(...);
Expected result:
for nr = ABC:50
nr = 50;
for nr = LKfasEWF:5039
nr = 5039
Good Afternoon
string nr = ABC:1
I would like to get the number after ":", how would you do it?
nr = nr.substring(...);
Expected result:
for nr = ABC:50
nr = 50;
for nr = LKfasEWF:5039
nr = 5039
To do this, just take the position that the character / string is, and then use the substring starting from that + 1 position. Here's an example.
string nr = "ABC: 1";
int posicaoCaractere = nr.IndexOf(": ");
nr = nr.Substring(posicaoCaractere+1);
MessageBox.Show(nr);