24.
What will be the output of the following C# code?
static void Main(string[] args)
{
    string s1 = " Cshr ";
    string s2 = s1.Insert(3 , " a ");
    string s3 = s2.Insert(5 , " p ");
    for (int i = 0;i < s3.Length; i++)
    Console.WriteLine(s3[i]);
    Console.ReadLine();
}

25.
What will be the output of the following C# code?
static void Main(string[] args)
{
    string s1 = "Hello I Love Csharp ";
    Console.WriteLine(Convert.ToChar( (s1.IndexOf('I') - s1.IndexOf('l')) * s1.IndexOf('p'));
    Console.ReadLine();
}

27.
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);

28.
What will be the output of the following C# code?
static void Main(string[] args)
{
    string s1 = "Hello";
    string s2 = "hello";
    if (s1 == s2)
    Console.WriteLine("Equal");
    else
    Console.WriteLine("Unequal");
    if (s1.Equals (s2))
    Console.WriteLine("Equal");
    else
    Console.WriteLine("Unequal");
    Console.ReadLine();
}

29.
What will be the output of the following C# code snippet?
static void main(String args[])
{
    char chars[] = {'x', 'y', 'z'};
    String s = new String(chars);
    Console.WriteLine(s);
}

30.
Choose the statements which are false in nature?

Read More Section(Arrays and Strings in C Sharp)

Each Section contains maximum 100 MCQs question on Arrays and Strings in C Sharp. To get more questions visit other sections.