xdash / pascalCase
Function: pascalCase()
pascalCase(
str
):string
Converts a string to PascalCase
Parameters
• str: string
string to convert
Returns
string
the string in PascalCase
Example
pascalCase('fooBar') // returns 'FooBar'
pascalCase('foo-bar') // returns 'FooBar'
pascalCase('foo_bar') // returns 'FooBar'
pascalCase('FOO_BAR') // returns 'FooBar'
pascalCase('foo') // returns 'Foo'
pascalCase('') // returns ''