Documentation
    Preparing search index...

    Variable convertCaseConst

    convertCase: (text: string, toCase: Case) => string

    Convert the text to the specified case

    Type declaration

      • (text: string, toCase: Case): string
      • Parameters

        • text: string
        • toCase: Case

        Returns string

    import { convertCase } from '@kitsuyui/string'
    convertCase('hello world', 'kebab-case') // => 'hello-world'
    convertCase('hello world', 'snake_case') // => 'hello_world'
    convertCase('hello world', 'space separated') // => 'hello world'
    convertCase('hello world', 'camelCase') // => 'helloWorld'
    convertCase('hello world', 'UpperCamelCase') // => 'HelloWorld'
    convertCase('hello world', 'lowerCamelCase') // => 'helloWorld'
    convertCase('hello world', 'PascalCase') // => 'HelloWorld'