Skip to content

pascalCase

Convert the string to PascalCase (also known as UpperCamelCase).

Added in v0.0.1

Usage

ts
import { pascalCase } from 'parsnip-kit'

pascalCase('HelloWorld') // 'HelloWorld'
pascalCase('helloWorld') // 'HelloWorld'
pascalCase('hello-world') // 'HelloWorld'
pascalCase('hello_world') // 'HelloWorld'
pascalCase('HELLO_WORLD') // 'HelloWorld'
pascalCase('Hello World') // 'HelloWorld'
pascalCase('-_HELLO World -_') // 'HelloWorld'

API

Arguments

ArgTypeOptionalDefaultDescription
arganyfalseundefinedThe string to be converted.

Returns

Type
string