How to I check whether a given character is within a string, well that's easy:
if (myString.Contains(myChar))
{
//TODO Logic
}
But, What I want is to get the index of the char |AND| get the index of the same char if it is in the word more than once.
So basically, i've got three variables:
string word = "USMAAN"
string wordTwo = "******"
char letter = "A";
So the compiler should do the following task:
First Index of the string word, It's "U", nope that doesn't == A, move on.
Second index of the string word, It's "S", nope that doesn't == A, move on.
Third Index of the string word, it's "M", nope that doesn't == A, move on.
Fourth index of the string word, it's "A", AHA! A == A, get the index.
Now change wordTwo to "***A**".
So on and so forth...
There might be many ways to implement this but, that's the problem I have at the moment.
I have two string and one char to test with....
How could I implement this?