“majuscule dans le mot javascript” Réponses codées

javascript capitaliser les mots

//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(); });
};
Grepper

chaîne de majuscules en js

var str = "Hello World!";
var res = str.toUpperCase();  //HELLO WORLD!
Batman

majuscule dans le mot javascript

function toTitleCase(str) {
    return str.replace(/\w\S*/g, function(txt){
        return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
}
Clever Caracal

javascript capitaliser les mots

//Updated 
//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(); });
};
rabbit.sol

Réponses similaires à “majuscule dans le mot javascript”

Questions similaires à “majuscule dans le mot javascript”

Plus de réponses similaires à “majuscule dans le mot javascript” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code