GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Full-Pack
  • GitHub
  • Getting Started
  • merge
  • reverse
  • compare
  • padding
  • regionMatchers
  • caseConversion
  • caseValidation

This view

  • Original page
  • New address

GeezerVison is showing full-pack.github.io — CaseConversion

CaseConversion

capitalizeInitial

Section titled “capitalizeInitial”

Capitalizes the first letter of a word in a string.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The string with the first letter capitalized.

Definition
function capitalizeInitial(str: string, locales?: Intl.LocalesArgument): string
Examples
capitalizeInitial('hello') // 'Hello'
capitalizeInitial(':> hello') // ':> Hello'

capitalizeWords

Section titled “capitalizeWords”

Capitalizes the first letter of each word in a given string.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The input string with the first letter of each word capitalized.

Definition
function capitalizeWords(str: string, locales?: Intl.LocalesArgument): string
Examples
capitalizeWords('hello world') // 'Hello World'
capitalizeWords('This was your big idea, remember?') // 'This Was Your Big Idea, Remember?'

snakeCase

Section titled “snakeCase”

Converts a string to snake_case format.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • inWords: boolean If true, converts numbers to words in snake_case format.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The string converted to snake_case format.

Definition
function snakeCase(str: string, inWords?: boolean, locales?: Intl.LocalesArgument): string
Examples
snakeCase('hello WorLd') // 'hello_world'
snakeCase('from-kebab-case') // 'from_kebab_case'
snakeCase('snake Case With Numbers123', true) // 'snake_case_with_numbers_one_two_three'

kebabCase

Section titled “kebabCase”

Converts a string to kebab-case format.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • inWords: boolean If true, converts numbers to words in kebab-case format.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The string converted to kebab-case format.

Definition
function kebabCase(str: string, inWords?: boolean, locales?: Intl.LocalesArgument): string
Examples
kebabCase('h3llo WoRld') // 'h3llo-world'
kebabCase('from_snake_case') // 'from-snake-case'
kebabCase('kebab Case With Numbers123', true) // 'kebab-case-with-numbers-one-two-three'

camelCase

Section titled “camelCase”

Converts a string to camelCase format.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The string converted to camelCase format.

Definition
function camelCase(str: string, locales?: Intl.LocalesArgument): string
Examples
camelCase('hello WoRld') // 'helloWorld'
camelCase('Test CaSe ExamplE') // 'testCaseExample'
camelCase('camel Case With Numbers123') // 'camelCaseWithNumbers'

pascalCase

Section titled “pascalCase”

Converts a string to PascalCase format.

Parameters

Section titled “Parameters”
  • str: string - The input string.
  • locales?: Intl.LocalesArgument - BCP 47 language tag(s) for case conversion (e.g., ‘en-US’).

Returns: string

Section titled “Returns: string”

The string converted to PascalCase format.

Definition
function PascalCase(str: string, locales?: Intl.LocalesArgument): string
Examples
pascalCase('hello WoRld') // 'HelloWorld'
pascalCase('Test CaSe ExamplE') // 'TestCaseExample'
pascalCase('pasCal Case With Numbers123') // 'PascalCaseWithNumbers'
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.