VOOZH about

URL: https://www.geeksforgeeks.org/javascript/lodash-_-camelcase-method/

⇱ Lodash _.camelCase() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Lodash _.camelCase() Method

Last Updated : 18 Oct, 2023

Lodash _.camelCase() method is used to convert a string into a camel case string. The string can be space-separated, dash-separated, or can be separated by underscores.

Syntax:

_.camelCase(string);

Parameters:

  • string: This parameter holds the string that needs to be converted into a camel case string.

Return Value:

This method returns the camel case string

Example 1: In this example, we are changing the string which is space-separated and dash-separated into the camel case using the _.camelCase() method.

Output:

geeksForGeeks
gfgGeeks

Example 2: In this example, we are changing the string which is underscore-separated into the camel case using the _.camelCase() method.

Output:

geeksForGeeks
gfgGeeks
Comment