[Solved-5 Solutions] First letter of a string uppercase - javascript tutorial
Problem
How to make the first letter of a string as uppercase, but don't change other letters in uppercase ?
Solution 1:
- In the given strings to make the first string as capitalized: uppercase its first letter, and remaining strings to be lowercase.
- This problem to overcome by the combination of two functions. The first letter to be uppercases and starting from the second slices string to at the end string as lowercase.
Solution 2:
You can use this solution:
Read Also
AngularJS UppercaseSolution 3:
This approach is an object-oriented:
And then:
Solution 4:
In CSS:
Solution 5:
In early version that gets the first letter by treating the string as an array:
This doesn't work in IE 7 or below.
We want remove empty string from the given strings:
Read Also
Java Strings toUpperCase() methodSolution 6:
We need to capitalize the first letter and lowercase couldn't be change. Using this function some changes will be occur.