Which one of the following expressions can be used to extract the last five characters from any string variable str?
A) str.substring(str.length() - 5, str.length() )
B) str.substring(5, 5)
C) str.substring(str.length() - 4, 5)
D) str.substring(str.length() - 5, 5)
Correct Answer:
Verified
Q110: What is the output of the following
Q111: Assuming that the user inputs "Joe" at
Q112: Which operator is used to concatenate two
Q113: Which of the given System.out.print statements generates
Q114: What is the output of the following
Q116: How do you compute the length of
Q117: How do you extract the first 5
Q118: What is the output of the following
Q119: Which of the methods below are static
Q120: What is the output of the following
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents