transformCase
transformCase(
params):string
Defined in: strings/transform-case/index.ts:122
Converts a string between case styles.
Parameters
Section titled “Parameters”params
Section titled “params”TransformCaseParams
The parameters object
Returns
Section titled “Returns”string
The converted string
Example
Section titled “Example”transformCase({ str: "hello world", to: "camel" });// => "helloWorld"
transformCase({ str: "HTMLParser", to: "title", preserveAcronyms: true });// => "HTML Parser"Keywords
Section titled “Keywords”camelCase, snake_case, kebab-case, PascalCase, title case, Title Case, convert case, acronym
Throws
Section titled “Throws”Error if str is not a string
Throws
Section titled “Throws”Error if to is not a valid case style