71. The Method use to remove white space from a string?
72. Correct way to find if contents of two strings are equal?
73. Which of these methods can be used to convert all characters in a String into a character array?
74. What will be the output of the following C# code?
static void Main(string[] args)
{
String c = "Hello";
String a ;
a = c.Replace('l', 'w');
Console.WriteLine(a);
Console.ReadLine();
}
static void Main(string[] args)
{
String c = "Hello";
String a ;
a = c.Replace('l', 'w');
Console.WriteLine(a);
Console.ReadLine();
}
75. What will be the output of the following C# code snippet?
static void Main(string[] args)
{
String c = "Hello i love you";
String a ;
a = c.Substring(12, 3);
Console.WriteLine(a);
Console.ReadLine();
}
static void Main(string[] args)
{
String c = "Hello i love you";
String a ;
a = c.Substring(12, 3);
Console.WriteLine(a);
Console.ReadLine();
}
76. Which of the following statements are correct?
77. What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
Console.WriteLine(obj + " " + obj1);
string s = obj + " " + obj1;
Console.WriteLine(s.Length);
Console.ReadLine();
}
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
Console.WriteLine(obj + " " + obj1);
string s = obj + " " + obj1;
Console.WriteLine(s.Length);
Console.ReadLine();
}
78. Which of these methods returns the string such that some characters which are specified to be removed from the end of strings are removed from string by mentioning the number of characters to be removed?
79. What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
Console.WriteLine (obj.Equals(obj2) + " " + obj2.CompareTo(obj) );
Console.ReadLine();
}
static void Main(string[] args)
{
String obj = "hello";
String obj1 = "world";
String obj2 = obj;
Console.WriteLine (obj.Equals(obj2) + " " + obj2.CompareTo(obj) );
Console.ReadLine();
}
80. To perform comparison operation on strings supported operations are . . . . . . . .
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.