Quiz Complete, well Done!
Which string method is used to split a string into an array of substrings?
Which method is used to check if a string contains a specified sequence of characters?
Which method is used to compare two strings for equality?
Which string method is used to check if a string starts with a specified prefix?
What will the following code snippet output?
str = "Hello World!";
print(str.substring(6));
What is the output of the following code?
String str = "Hello World!";
System.out.println(str.substring(6, 11));
What is the output of the following code?
String str = " Hello ";
System.out.println(str.trim());
What is the function used to find the length of a string?
Which string method is used to convert a string to uppercase?
What happens if the start index is greater than the end index in a string slice?
Which method is used to convert a string to uppercase?
What will the following code snippet output?
string = 'Hello, world!'
new_string = string.replace('o', 'a', 2)
print(new_string)
What is the result of the expression "Hello".length()?
What is the result of a string slice operation?
Which string method is used to remove leading and trailing whitespace from a string?