Answers for "jquery uppercase first letter"

2

first letter capital in jquery

// Define function to capitalize the first letter of a string
function capitalizeFirstLetter(string){
  return string.charAt(0).toUpperCase() + string.slice(1);
}

// Calling function and display the result
var str1 = 'hi there!';
str1 = capitalizeFirstLetter(str1);
document.write(str1); // Print: Hi there!
Posted by: Guest on April-19-2021
98

js first letter uppercase

//capitalize only the first letter of the string. 
function capitalizeFirstLetter(string) {
    return string.charAt(0).toUpperCase() + string.slice(1);
}
//capitalize all words of a string. 
function capitalizeWords(string) {
    return string.replace(/(?:^|\s)\S/g, function(a) { return a.toUpperCase(); });
};
Posted by: Guest on July-22-2019
3

javascript uppercase first character of each word

const uppercaseWords = str => str.replace(/^(.)|\s+(.)/g, c => c.toUpperCase());

// Example
uppercaseWords('hello world');      // 'Hello World'
Posted by: Guest on July-03-2020
0

first letter uppercase in jquery

$('#test').css('text-transform', 'capitalize');
Posted by: Guest on September-26-2021

Code answers related to "jquery uppercase first letter"

Code answers related to "Javascript"

Browse Popular Code Answers by Language