Skip to main content

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'

Comments