+ 1
How to change the case of a single letter in a string ?
I have been given 2 strings as "hello" and "world". The output string required is "Hello World". How do i change the case of the first letter ?
1 Answer
+ 1
Hi Prateek.
varName = varName.toLowerCase()
varName = varName.substring(0, 1).toUpperCase() + varName.substring(1).toLowerCase()
// do this for each variable