i have been having trouble searching string for a specified char. I have been using the string.indexOf(char) but that only gives me the index of the first instance of the char not all the index values of the char.
for example..
string wordToSearch = "adadda";
if(wordToSearch.indexOf("a")) != -1)
messagebox.show("letter is not found in selected word");
else
{
//this displays only the first "a" of the string but i need to know the index values of
//all the "a"s in the string
messagebox.show("letter is found at " + wordToSearch.indexOf("a").toString());
}
or is this even possible without converting my string to an array of char values?