Lodash _.lowerFirst() Method
Lodash _.lowerFirst() method is used to convert the first character of the given string into lowercase characters.
Syntax:
_.lowerFirst([string='']);
Parameters:
- string: This parameter holds the string that needs to be converted.
Return Value:
This method returns the converted string.
Example 1: In this example, we are converting the first letter of the given string into lowercase by the use of the lodash _.lowerFirst() method.
Javascript
const _ = require( 'lodash' ); let str1 = _.lowerFirst( "Beginner FOR Beginner" ); console.log(str1); let str2 = _.lowerFirst( "GFG--Beginner" ); console.log(str2); |
Output:
"gEEKS FOR Beginner"
"gFG--Beginner"
Example 2: In this example, we are converting the first letter of the given string into lowercase by the use of the lodash _.lowerFirst() method.
Javascript
const _ = require( 'lodash' ); let str1 = _.lowerFirst( "Beginner__FOR__Beginner" ); console.log(str1); let str2 = _.lowerFirst( "G4G--Beginner--Beginner" ); console.log(str2); let str3 = _.lowerFirst( "Beginner-----FOR_____Beginner" ); console.log(str3); |
Output:
"gEEKS__FOR__Beginner"
"g4G--Beginner--Beginner"
"gEEKS-----FOR_____Beginner"
Contact Us