Answer: IndexOfAny method finds the first index of any of the char arguments. It returns -1 if none are found.It is a case-sensitive.It also return the integer value i.e. character position.We have to pass a character array as an argument.
For Example:-
string str1 = "Dot Net";
string str2 = "Funda";
int index_pos = str.IndexOfAny(new char[] { 'o', 'd' });
Asked In: Many Interviews |
Alert Moderator