Quiz Complete, well Done!
The
method removes leading and trailing whitespace from a string.
What is the output of the following code?
String str = "Hello World!";
System.out.println(str.substring(6, 11));
Which method is used to convert a string to uppercase?
Replacing
String slicing in Python is
, meaning the first character has an index of 0.
What is the result of the expression "Hello".length()?
The
method converts all characters in a string to lowercase.
The replace() method in Python is used to
a specified phrase with another specified phrase.
Concatenation
What is the output of the following code?
String str = "Hello";
System.out.println(str.replace("l", "L"));
String slicing can be helpful when manipulating and extracting
from strings.
The
method replaces a specified substring with another substring.
String slicing
Step value
String Manipulation
Length
To get the length of a string, you can use the
function.
End index
What does string slicing do?
The
method converts all characters in a string to uppercase.