Open In App
Related Articles

Lodash String Complete Reference

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc. Lodash String functions are used to perform operations on the string elements.

Methods

Description

_.camelCase()It is used to convert a string into a camel case string.
_.capitalize()It converts the first character of string to upper case and the remaining to lower case.
_.deburr()It converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters.
_.endsWith()It checks whether the string ends with the given target string or not.
_.escape()It converts the characters “&”, “<“, “>”, ‘”‘, and “‘” of given string into their corresponding HTML entities.
_.escapeRegExp()It is used to escape the Regular Expression special characters in string.
_.kebabCase()It converts the given string into kebab case string.
_.lowerCase()It converts the given string, as space separated words, to lower case.
_.lowerFirst()It converts the first character of the given string into lower case characters.
_.pad()It is used to pad the string on left and right sides if it is shorter than the given length.
_.padEnd()It is used to pad a string with another string until it reaches the given length.
_.padStart()It is used to pad a string with another string until it reaches the given length.
_.parseInt()It is used to parse a string argument and returns an integer of the specified radix.
_.repeat()It is used to repeat the given string n times.
_.replace()This method replace the matches for pattern in string with replacement.
_.snakeCase()It is used to convert string to snake case.
_.split()It splits the given string by the given separator and up to the given limit length.
_.startCase()It is used to convert the string to start the case.
_.startsWith()It is used to find if the string starts with the given target string or not.
_.template()It is used to create a template function.
_.toLower()It converts the entire string to lower case.
_.toUpper()It converts the entire string to Upper case.
_.trim()It removes leading and trailing white spaces or specified characters from the given string.
_.trimEnd()It removes trailing white spaces or specified characters from the end of the given string.
_.trimStart()It removes leading white spaces or specified characters from the given string.
_.truncate()It is used to truncate the stated string if it is longer than the specified string length.
_.unescape()It convert HTML entities into given string to their corresponding characters.
_.upperCase()It converts the entire string to as space-separated words, to upper case.
_.upperFirst()It converts the first character of the string to the upper case.
_.words()It splits the given string into an array of words.

Last Updated : 26 Jul, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads