I have a string 'name' and want to make the substring the last number from this string.
string name = "1100_PF_R_06230_1"; textBox1.Text = (name.Substring(name.Length - 1, 1));
the name string changes accordingly as the file number, so the string name becomes.
1100_PF_R_06230_1 1100_PF_R_06230_2 1100_PF_R_06230_3 1100_PF_R_06230_4 1100_PF_R_06230_5 1100_PF_R_06230_6 1100_PF_R_06230_7 1100_PF_R_06230_8 1100_PF_R_06230_9 1100_PF_R_06230_10
when it reaches 10, my substring gives me 0, and the file starts again with 1. I want to substitute the name from the last underscore '_' so that I can add a number to it.
please, help.
source share