Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following C# code?
string s1 = ” I AM BEST “;
string s2;
s2 = s1.substring (5, 4);
Console.WriteLine (s2);

What will be the output of the following C# code?
string s1 = ” I AM BEST “;
string s2;
s2 = s1.substring (5, 4);
Console.WriteLine (s2);
a) AM BEST
b) I AM BES
c) BEST
d) I AM

Answer: c
Explanation: Substring() of string class used to extract substrings from given string. In the given substring condition, it extracts a substring beginning at 5th position and ending at 4th position.

Join The Discussion