GitHub 6248★

Make the first character of a string lowercase

JavaScript version

const lowercaseFirst = (str) => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;

TypeScript version

const lowercaseFirst = (str: string): string => `${str.charAt(0).toLowerCase()}${str.slice(1)}`;

Examples

lowercaseFirst('Hello World'); // 'hello World'
Follow me on and to get more useful contents.