Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes
asked in CSC211_Winter2018 by (1 point)

1 Answer

+8 votes

str1.toLowerCase() returns the lower case version of "Frodo Baggins" which is "frodo baggins". The indexOf("B") method is on the string "frodo baggins". Since "frodo baggins" has no capital B, then indexOf method returns -1.

answered by (1 point)
...