C# Programming - Strings

Why should I learn to solve C# Programming questions and answers section on "Strings"?

Learn and practise solving C# Programming questions and answers section on "Strings" to enhance your skills so that you can clear interviews, competitive examinations, and various entrance tests (CAT, GATE, GRE, MAT, bank exams, railway exams, etc.) with full confidence.

Where can I get the C# Programming questions and answers section on "Strings"?

IndiaBIX provides you with numerous C# Programming questions and answers based on "Strings" along with fully solved examples and detailed explanations that will be easy to understand.

Where can I get the C# Programming section on "Strings" MCQ-type interview questions and answers (objective type, multiple choice)?

Here you can find multiple-choice C# Programming questions and answers based on "Strings" for your placement interviews and competitive exams. Objective-type and true-or-false-type questions are given too.

How do I download the C# Programming questions and answers section on "Strings" in PDF format?

You can download the C# Programming quiz questions and answers section on "Strings" as PDF files or eBooks.

How do I solve C# Programming quiz problems based on "Strings"?

You can easily solve C# Programming quiz problems based on "Strings" by practising the given exercises, including shortcuts and tricks.

Exercise : Strings - General Questions
  • Strings - General Questions
1.
Which of the following statements are true about the C#.NET code snippet given below?
String s1, s2; 
s1 = "Hi"; 
s2 = "Hi";
  1. String objects cannot be created without using new.
  2. Only one object will get created.
  3. s1 and s2 both will refer to the same object.
  4. Two objects will get created, one pointed to by s1 and another pointed to by s2.
  5. s1 and s2 are references to the same object.
1, 2, 4
2, 3, 5
3, 4
2, 5
Answer: Option
Explanation:
No answer description is available. Let's discuss.

2.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "ALL MEN ARE CREATED EQUAL";
String s2;
s2 = s1.Substring(12, 3); 
Console.WriteLine(s2);
ARE
CRE
CR
REA
CREATED
Answer: Option
Explanation:
No answer description is available. Let's discuss.

3.
Which of the following statements will correctly copy the contents of one string into another ?
String s1 = "String";
String s2; 
s2 = s1;
String s1 = "String" ; 
String s2;
s2 = String.Concat(s1, s2);
String s1 = "String"; 
String s2;
s2 = String.Copy(s1);
String s1 = "String"; 
String s2;
s2 = s1.Replace();
String s1 = "String"; 
String s2;
s2 = s2.StringCopy(s1);
Answer: Option
Explanation:
No answer description is available. Let's discuss.

4.
The string built using the String class are immutable (unchangeable), whereas, the ones built- using the StringBuilder class are mutable.
True
False
Answer: Option
Explanation:
No answer description is available. Let's discuss.

5.
Which of the following will be the correct output for the C#.NET code snippet given below?
String s1 = "Nagpur";
String s2;
s2 = s1.Insert(6, "Mumbai"); 
Console.WriteLine(s2);
NagpuMumbair
Nagpur Mumbai
Mumbai
Nagpur
NagpurMumbai
Answer: Option
Explanation:
No answer description is available. Let's discuss.