String Methods Flashcards
(1 cards)
1
Q
How do you change a string to all upper case? lower case? just a specific character? And what is something to note about how/when this can work, and when it won’t?
A
string.toUpperCase()… string.toLowerCase()… string.charAt(2).toUpperCase()… you have to assign it to a variable, because you can’t change the original string directly as it’s immutable.