Module

Data.String.Extra

#camelCase

camelCase :: String -> String

Converts a String to camel case

camelCase "Hello world" == "helloWorld"

#kebabCase

kebabCase :: String -> String

Converts a String to kebab case

kebabCase "Hello world" == "hello-world"

#pascalCase

pascalCase :: String -> String

Converts a String to Pascal case

pascalCase "Hello world" == "HelloWorld"

#snakeCase

snakeCase :: String -> String

Converts a String to snake case

snakeCase "Hello world" == "hello_world"

#upperCaseFirst

upperCaseFirst :: String -> String

Converts the first character in a String to upper case, lower-casing the rest of the string.

upperCaseFirst "hello World" == "Hello world"

#words

words :: String -> Array String

Separates a String into words based on Unicode separators, capital letters, dashes, underscores, etc.

words "Hello_world --from TheAliens" == [ "Hello", "world", "from", "The", "Aliens" ]

#levenshtein

levenshtein :: String -> String -> Int

Calculates the Levenshtein distance between two strings.

levenshtein "book" "back" -- 2

#sorensenDiceCoefficient

sorensenDiceCoefficient :: String -> String -> Number

Calculates the Sørensen-Dice coefficient between two strings.

sorensenDiceCoefficient "WHIRLED" "WORLD" -- 0.2000

Modules