1.
Make clone of string
Correct Answer
B. Clone
Explanation
The correct answer is "clone" because the question is asking for a term that means "to make a duplicate or copy of a string." The word "clone" accurately describes this action, as it refers to creating an identical or nearly identical copy of an object or entity.
2.
This method replaces the character
Correct Answer
B. Replace
Explanation
This method refers to the action of replacing a character with another character. It is a specific operation that involves substituting one character for another within a given string or text. The answer "Replace" accurately describes this action, indicating that the method is used to replace a character.
3.
Converts string into upper case
Correct Answer
A. ToUpper
Explanation
The correct answer is "ToUpper". This function is used to convert a string into uppercase letters.
4.
This method deletes all the characters from beginning to specified index position.
Correct Answer
B. Remove
Explanation
This method refers to removing characters from a specified index position. It is different from deleting as it only eliminates characters starting from the specified index, rather than deleting the entire string. The options "Delete" and "Trim" do not accurately describe this action, leaving "Remove" as the correct answer.
5.
This method checks whether specified character or string is exists or not in the string value
Correct Answer
C. Contains
Explanation
The given answer "Contains" is correct because the method mentioned in the explanation checks whether a specified character or string exists or not in the given string value. Therefore, the correct option is "Contains" as it accurately describes the functionality of the method.
6.
It checks whether the first character of string is same as specified character.
Correct Answer
A. StartsWith
Explanation
StartsWith is the correct answer because it is a method used to check whether a string starts with a specified character or substring. In this case, the explanation states that it checks whether the first character of the string is the same as the specified character. Therefore, StartsWith is the appropriate choice as it aligns with the given explanation.
7.
Converts string into lower case
Correct Answer
B. ToLower
Explanation
The function "ToLower" is used to convert a string into lowercase letters. This function takes a string as input and returns the same string with all the uppercase letters converted to lowercase. It is commonly used in programming to standardize the case of strings for comparison or display purposes. The other options mentioned in the question ("lcase" and "ToLowerCase") are not valid functions or methods in most programming languages, making "ToLower" the correct answer.
8.
It removes extra whitespaces from beginning and ending of string
Correct Answer
A. Trim
Explanation
The Trim function is used to remove any extra whitespace characters from both the beginning and the end of a string. This is useful for cleaning up user inputs or removing any unnecessary spaces. The LTrim function only removes whitespace from the beginning of the string, while the RTrim function only removes whitespace from the end. Therefore, the correct answer is Trim.
9.
The CompareTo() function compare two strings and returns integer value as output. The integer value for true is ?
Correct Answer
B. 0
Explanation
The CompareTo() function in Java compares two strings lexicographically. It returns an integer value that represents the difference between the two strings. If the two strings are equal, the CompareTo() function returns 0. Therefore, the correct integer value for true in this case is 0.
10.
What conditional statement branch out to check more than one condition?
Correct Answer
D. If-else-if statement
Explanation
The if-else-if statement is a conditional statement that allows for multiple conditions to be checked. It provides a way to branch out and execute different blocks of code based on the evaluation of each condition. When the initial if statement evaluates to false, the program moves on to the next else-if statement, and so on, until a condition evaluates to true or until the final else statement is reached. This allows for more complex decision-making in programming by considering multiple conditions.