How to continue from where I have been searching to find the index?
I am searching in a file to find the index of a character; then I have to continue from there to find the index of the next character. For example : string is " habcdefghij"
int index = message.IndexOf("c");
Label2.Text = index.ToString();
label1.Text = message.Substring(index);
int indexend = message.IndexOf("h");
int indexdiff = indexend - index;
Label3.Text = message.Substring(index,indexdiff);
so it should return "cedef"
but the second search starts from the beginning of the file, it will return the index of first h rather than second h:-(