Open In App

Lodash _.lowerFirst() Method

Last Updated : 27 Oct, 2023
Comments
Improve
Suggest changes
Like Article
Like
Report

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("GEEKS FOR GEEKS");
console.log(str1);

let str2 = _.lowerFirst("GFG--Geeks");
console.log(str2);

Output:

"gEEKS FOR GEEKS"
"gFG--Geeks"

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("GEEKS__FOR__GEEKS");
console.log(str1);

let str2 = _.lowerFirst("G4G--geeks--GEEKS");
console.log(str2);

let str3 = _.lowerFirst("GEEKS-----FOR_____Geeks");
console.log(str3);

Output:

"gEEKS__FOR__GEEKS"
"g4G--geeks--GEEKS"
"gEEKS-----FOR_____Geeks"

Next Article

Similar Reads