a) We can modify characters included in the string b) We cannot modify characters contained in the string
View QuestionWhat is the String in C# meant for?
a) Variable b) Character Array c) Object d) Class Answer: c Explanation: C# Supports a predefined reference ...
View QuestionThe Method use to remove white space from a string?
a) Split() b) Substring() c) Trim() d) TrimStart() Answer: c Explanation: Perfectly removes whitespace from string whereas ...
View QuestionWhich of these operators can be used to concatenate two or more String objects?
a) + b) += c) & d) || Answer: a Explanation: ...
View QuestionWhich of the following statements are correct?
a) String is value type b) String literals can contain any character literal including escape sequences c) The ...
View QuestionCorrect way to find if contents of two strings are equal?
a) if (s1 = s2) b) if (s1 != s2) c) if (strcmp (s1 ,s2)) d) if ( ...
View Question
What will be the output of the following C# code?
static void Main(string[] args)
{
string s1 = “Hello” + ” I ” + “Love” + ” ComputerScience “;
Console.WriteLine(s1);
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 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();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View QuestionWhich of the following statement is correct about a string in C#.NET?
a) The System.Array class is used to represent a string b) A string has a zero-based index c) ...
View Question
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();
}
What will be the output of the following C# code? static void Main(string[] args) { ...
View Question