Which Among The Following Is The Correct Way To Find Out The #266
Which among the following is the correct way to find out the index of second ‘s’ in the string “She sold her beauty in one night to someone else”?
This multiple choice question (MCQ) is related to the book/course gs gs108 CSharp. It can also be found in gs gs108 Arrays and Strings - Searching and Modifying Strings - Quiz No.1.
Which among the following is the correct way to find out the index of second ‘s’ in the string “She sold her beauty in one night to someone else”?
String a = "She sold her beauty in one night to someone else"; int i; i = a.SecondIndexOf("s");
String a = "She sold her beauty in one night to someone else"; int i, j; i = a.FirstIndexOf("s"); j = a.IndexOf("s", i + 1);
String a = "She sold her beauty in one night to someone else"; int i, j; i = a.IndexOf("s"); j = a.IndexOf("s", i + 1);
None of the mentioned