a) Equals () b) == operator c) Compare() d) None of the mentioned Answer: c Explanation: The ...
View QuestionWhich of these methods of class String is used to compare two String objects for their equality?
a) equals() b) Equals() c) isequal() d) Isequal() Answer: a Explanation: equals()
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = “hello”;
String obj1 = “worn”;
String obj2 = obj;
Console.WriteLine(obj + ” ” + (obj1.Replace(‘w’ ,’c’)));
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = “hello”;
String obj1 = “world”;
String obj2 = obj;
string s = obj + ” ” + obj1;
Console.WriteLine(s.Substring(6 ,5));
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
String obj = “hello”;
String obj1 = “world”;
String obj2 = obj;
string s = obj+” “+obj1;
Console.WriteLine(s.IndexOf(‘r’));
Console.ReadLine();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
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();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question
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();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View QuestionCorrect way to convert a string to uppercase using string class method()?
a) Upper() b) ToUpper() c) Object.ToUpper() d) None of the mentioned Answer: c Explanation: ...
View Question
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();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View QuestionTo perform comparison operation on strings supported operations are ____________
a) Compare() b) Equals() c) Assignment ‘==’ operator d) All of the mentioned Answer: d Explanation: All ...
View Question