2011-05-04 5 views

Respuesta

33

Aquí es una función que hace

function firstToUpperCase(str) { 
    return str.substr(0, 1).toUpperCase() + str.substr(1); 
} 

var str = 'hello, I\'m a string'; 
var uc_str = firstToUpperCase(str); 

console.log(uc_str); //Hello, I'm a string 
Cuestiones relacionadas