1)

What is the output for the C#.NET code given below?

string s1 = " I AM OK ";
string s2;
s2 = s1.substring (6, 2);
Console.WriteLine (s2);


A) AM OK

B) AM

C) OK

D) I AM O

Answer:

Option C

Explanation:

Substring() is used to extract substring from the given string. In this condition, it extracts a substring beginning at 6th position with 2 characters.