The _.lowerFirst() method is used to convert the first character of the given string into lower case characters.
Syntax:
_.lowerFirst([string=''])
Parameters: This method accepts single parameter as mentioned above and described below:
- string: This parameter holds the string that need to convert.
Return Value: This method return the converted string.
Example 1:
Javascript
const _ = require( 'lodash' ); var str1 = _.lowerFirst( "GEEKS FOR GEEKS" ); console.log(str1); var str2 = _.lowerFirst( "GFG--Geeks" ); console.log(str2); |
Output:
"gEEKS FOR GEEKS" "gFG--Geeks"
Example 2:
Javascript
const _ = require( 'lodash' ); var str1 = _.lowerFirst( "GEEKS__FOR__GEEKS" ); console.log(str1); var str2 = _.lowerFirst( "G4G--neveropen--GEEKS" ); console.log(str2); var str3 = _.lowerFirst( "GEEKS-----FOR_____Geeks" ); console.log(str3); |
Output:
"gEEKS__FOR__GEEKS" "g4G--neveropen--GEEKS" "gEEKS-----FOR_____Geeks"