Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Take Free Test
Strings Questions
In the C standard library, which function finds the first occurrence of a given substring within another string (i.e., searches for one string inside a larger string)?
In C, how would you print the two literal characters backslash and n (i.e., the text ' ') on the screen using printf?
Which C library function returns a pointer to the last occurrence of a specified character within a null-terminated string?
Which function sets the first n characters of a C string to a specified character (use the best match among the listed options)?
For two strings s1 and s2 in C, what does strcmp(s1, s2) return if the strings are identical in content and length?
Which of the following function is correct that finds the length of a string?
In C input/output programming, which standard library function is most appropriate for reading a multi-word string that includes spaces from standard input?
C#.NET strings: What will be printed by the following code when comparing two differently cased strings? String s1 = 'Five Star'; String s2 = 'FIVE STAR'; int c; c = s1.CompareTo(s2); Console.WriteLine(c); Choose the correct result of the call to CompareTo (case-sensitive, culture-aware comparison).
C#.NET string interning and object references: consider the code String s1, s2; s1 = 'Hi'; s2 = 'Hi'; Which statements about object creation and references are true?
C#.NET String.Insert: determine the output of String s1 = 'Nagpur'; String s2; s2 = s1.Insert(6, 'Mumbai'); Console.WriteLine(s2); What is printed?
C#.NET: Correct ways to convert a String to an int (assume s = '123'). Select all valid C# approaches.
C#.NET strings: What is the correct way to compare two string variables s1 and s2 for equality of contents (not assignment)?
C#.NET strings vs. StringBuilder: choose the correct statement about mutability and immutability.
Where are C#.NET String objects created? Choose the correct statement about the memory location of a String.
String and StringBuilder in C#.NET: select the correct statements. 1) Two strings can be concatenated using s3 = s1 + s2; 2) String is a primitive in C#.NET. 3) A string built with StringBuilder is mutable. 4) A string built with String is immutable. 5) Two strings can be concatenated using s3 = s1 & s2;
Comparing string contents in C#.NET: which of the following are valid ways to determine if two strings s1 and s2 have equal contents? 1) if(s1 = s2) 2) if(s1 == s2) 3) int c; c = s1.CompareTo(s2); 4) if(strcmp(s1, s2)) 5) if (s1 is s2)
Copying the contents of one string to another in C#.NET: choose the statement that correctly creates a new string with the same contents as an existing one.
C#.NET — What does this program print? namespace CuriousTabConsoleApplication { class SampleProgram { static void Main(string[] args) { string str = "Hello World!"; Console.WriteLine(String.Compare(str, "Hello World?").GetType()); } } } Predict the exact console output when the program runs.
C#.NET — Which is the correct way to find the index of the second 's' in the string: "She sells sea shells on the sea-shore"? Choose the valid code snippet that correctly identifies the second occurrence.
C#.NET strings — identify the correct statements about string type, literals, equality, bounds, and mutability.
1
2
3