C# Programming - Strings - Discussion

Discussion Forum : Strings - General Questions (Q.No. 2)
2.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3); 
Console.WriteLine(s2);
ARE
CRE
CR
REA
CREATED
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
12 comments Page 2 of 2.

Gloops said:   1 decade ago
With just one less in the first argument of Substring, you obtained " CR", but this is not answer C as it does not include the space.

@Mallu :

Please just have a look there :
http://msdn.microsoft.com/en-US/library/aka44szs%28v=vs.110%29.aspx.

Naveen said:   9 years ago
The count starts from 0 or 1?


Post your comments here:

Your comments will be displayed after verification.