Categories
JavaScript Answers

How to convert string to title case with Lodash and JavaScript?

Spread the love

Sometimes, we want to convert string to title case with Lodash and JavaScript.

In this article, we’ll look at how to convert string to title case with Lodash and JavaScript.

How to convert string to title case with Lodash and JavaScript?

To convert string to title case with Lodash and JavaScript, we call the startCase function.

For instance, we write

const s = _.startCase(_.toLower(str));

to call startCase with a string to convert the _.toLower(str) lower case string to a title case string.

Conclusion

To convert string to title case with Lodash and JavaScript, we call the startCase function.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *