C# Programming - Strings - Discussion
Discussion Forum : Strings - General Questions (Q.No. 9)
9.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1="Kicit";
Console.Write(s1.IndexOf('c') + " ");
Console.Write(s1.Length);Discussion:
12 comments Page 2 of 2.
Sandeep said:
1 decade ago
If the index start in 0th element then it would be 24 how is 25 I can't understand.
Purusottam said:
1 decade ago
A String has a zero-based index,
So index of c is 2.
So index of c is 2.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers