Data.String.Casing
- Package
- purescript-heckin
- Repository
- maxdeviant/purescript-heckin
#toCamelCase Source
toCamelCase :: String -> String
Converts the given string to camelCase.
In camelCase each word starts with an uppercase letter except for the first word, which starts with a lowercase letter.
toCamelCase "Hello World" == "helloWorld"
toCamelCase "Player ID" == "playerId"
toCamelCase "XMLHttpRequest" == "xmlHttpRequest"
#toPascalCase Source
toPascalCase :: String -> String
Converts the given string to PascalCase.
In PascalCase the first letter of each word is uppercase.
toPascalCase "Hello World" == "HelloWorld"
toPascalCase "Player ID" == "PlayerId"
toPascalCase "XMLHttpRequest" == "XmlHttpRequest"
#toSnakeCase Source
toSnakeCase :: String -> String
Converts the given string to snake_case.
In snake_case all letters are lowercase and each word is separated by an
underscore (_
).
toSnakeCase "Hello World" == "hello_world"
toSnakeCase "Player ID" == "player_id"
toSnakeCase "XMLHttpRequest" == "xml_http_request"
#toScreamingSnakeCase Source
toScreamingSnakeCase :: String -> String
Converts the given string to SCREAMING_SNAKE_CASE.
In SCREAMING_SNAKE_CASE all letters are uppercase and each word is separated
by an underscore (_
).
toScreamingSnakeCase "Hello World" == "HELLO_WORLD"
toScreamingSnakeCase "Player ID" == "PLAYER_ID"
toScreamingSnakeCase "XMLHttpRequest" == "XML_HTTP_REQUEST"
#toKebabCase Source
toKebabCase :: String -> String
Converts the given string to kebab-case.
In kebab-case all letters are lowercase and each word is separated by a
hyphen (-
).
toKebabCase "Hello World" == "hello-world"
toKebabCase "Player ID" == "player-id"
toKebabCase "XMLHttpRequest" == "xml-http-request"
#toTitleCase Source
toTitleCase :: String -> String
Converts the given string to Title Case.
In Title Case the first letter of each word is uppercase and each word is
separated by a space ().
toTitleCase "Hello World" == "Hello World"
toTitleCase "Player ID" == "Player Id"
toTitleCase "XMLHttpRequest" == "Xml Http Request"
- Modules
- Data.
String. Casing