I have this:
string strings = "a b c d d e";
And I need something similar to string.Contains(), but I need to know not only whether a string is present(in case above a letter), but also if it is present only ONE SINGLE time.
How can I achieve this?
You can use
LastIndexOf(String)andIndexOf(String)and verify that the values returned are equal. Of course also check if the String is found at all(i.e the returned value is not -1).