Skip to content

@technobuddha > library > Programming > Variables

Function: pascalCase()

ts
function pascalCase(input: string): string;

Defined in: pascal-case.ts:20

Convert an identifier string to pascal case

Parameters

ParameterTypeDescription
inputstringThe identifier string

Returns

string

the identifier in pascal case

Example

typescript
pascalCase('hello world'); // 'HelloWorld'
pascalCase('Hello world'); // 'HelloWorld'
pascalCase('foo_bar-baz'); // 'FooBarBaz'
pascalCase('FOO BAR'); // 'FooBar'