Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Capitalizar un String completo
- mistring = "nube colectiva";
- a = mistring.toUpperCase();
- //console.log(a);
- // Capitalizar la primera letra de un String
- b = mistring.replace(/^\w/, (c) => c.toUpperCase());
- //console.log(b);
- // Capitalizar todas las letras de un String
- c = mistring.replace(/\w\S*/g, (w) => (w.replace(/^\w/, (c) => c.toUpperCase())));
- console.log(c);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement