stack

Home > @infiniteobjects/core-library-web > ChangeCase > toPascal

ChangeCase.toPascal() method

Converts string to [pascal case](https://en.wikipedia.org/wiki/Camel_case) which is a type of camel case with the first letter capitalized.

Signature:

static toPascal(str: string): string;

Parameters

Parameter Type Description
str string  

Returns:

string

Example

ChangeCase.toPascal('Foo Bar');
// => 'FooBar'

ChangeCase.toPascal('fooBar');
// => 'FooBar'

ChangeCase.toPascal('__FOO_BAR__');
// => 'FooBar'