Question: Assuming that the following variables have been declared: evaluate the following expressions: a. str1.length() b. str1.charAt(7) c. str2.charAt(0) d. str1.indexOf(o) e. str2.toUpperCase() f. str1.toLowerCase().indexOf(B) g.
Assuming that the following variables have been declared:

evaluate the following expressions:
a. str1.length()
b. str1.charAt(7)
c. str2.charAt(0)
d. str1.indexOf("o")
e. str2.toUpperCase()
f. str1.toLowerCase().indexOf("B")
g. str1.substring(4)
h. str2.substring(3, 14)
i. str2.replace("a", "oo")
j. str2.replace("gray", "white")
k. "str1".replace("r", "range")
// index 0123456789012345 String stri = "Frodo Baggins"; String str2 "Gandalf the GRAY";
Step by Step Solution
3.41 Rating (157 Votes )
There are 3 Steps involved in it
Results of String expressions ... View full answer
Get step-by-step solutions from verified subject matter experts
