/
How do I change the case of a string?

How do I change the case of a string?

There are methods .toUpperCase() and .toLowerCase() which will work. For example:

You can write helper functions to do more sophisticated string case changes like changing the first letter to a capital and the rest in lower case:

function APPcapitalize(S) { return S.charAt(0).toUpperCase() + S.substr(1); }

It’s usually easiest to google particular string methods.

 

Related content

How can I get part of string?
How can I get part of string?
Read with this
Avoid text-transform : uppercase;
Avoid text-transform : uppercase;
More like this
How do we add and increment Javascript numbers?
How do we add and increment Javascript numbers?
Read with this
Don't use CSS rules to capitalize headings
Don't use CSS rules to capitalize headings
More like this
How can we make a string with embedded " or ' characters?
How can we make a string with embedded " or ' characters?
Read with this
How can do some funky thing with strings that I don't know?
How can do some funky thing with strings that I don't know?
More like this