Convert to Pascal Case

Convert a string to PascalCase format, capitalizing each word and removing separators.

Code

General
str.toLowerCase().replace(/(^|[-_\s]+)(.)?/g, (_, __, c) => c ? c.toUpperCase() : '');

Parameters

The string to convert to PascalCase

Browser·fetch() may be limited by CORS

More JavaScript Snippets