Skip to content

constantCase

constantCase(string) → string · String

Convert a string to CONSTANT_CASE (uppercase with underscores).

  • string (required): the string to convert
utlx
constantCase("hello world")        // "HELLO_WORLD"
constantCase("camelCase")          // "CAMEL_CASE"
constantCase("some-kebab-case")    // "SOME_KEBAB_CASE"

Released under AGPL-3.0.