18 lines
531 B
JavaScript
Raw Permalink Normal View History

2026-05-31 13:21:13 +02:00
//#region src/string/lowerFirst.ts
/**
* Converts the first character of string to lower case.
*
* @param {string} str - The string that is to be changed
* @returns {string} - The converted string.
*
* @example
* const convertedStr1 = lowerCase('fred') // returns 'fred'
* const convertedStr2 = lowerCase('Fred') // returns 'fred'
* const convertedStr3 = lowerCase('FRED') // returns 'fRED'
*/
function lowerFirst(str) {
return str.substring(0, 1).toLowerCase() + str.substring(1);
}
//#endregion
exports.lowerFirst = lowerFirst;