10 examples of 'typescript capitalize' in JavaScript

Every line of 'typescript capitalize' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
22function _capitalize(string) {
23 return string && (string.charAt(0).toUpperCase() + string.slice(1));
24}
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

7export function capitalize (string) {
8 return string && (string.charAt(0).toUpperCase() + string.slice(1))
9}
19module.exports.capitalize = function capitalize(str) {
20 return str.charAt(0).toUpperCase() + str.slice(1, str.length);
21};
7function capitalize(str) {
8 return str && str[0].toUpperCase() + str.slice(1);
9}
90function capitalize(s) {
91 return s && s.charAt(0).toUpperCase() + s.slice(1)
92}
9function capitalize (word) {
10 var lower = word.toLowerCase();
11 return lower.slice(0, 1).toUpperCase() + lower.slice(1);
12}
59export function capitalize(word) {
60 const str = `${word}`;
61 return str.charAt(0).toUpperCase() + str.slice(1);
62}
749function capitalize(string) {
750 return string.charAt(0).toUpperCase() + string.slice(1);
751}
62capitalize(s) {
63 return s && s[0].toUpperCase() + s.slice(1);
64}
21export function capitalize(str) {
22 return ucFirst(str);
23}

Related snippets