Data.String.Common - purescript-strings - Pursuit (original) (raw)
Package
Repository
#localeCompare Source
localeCompare :: String -> String -> Ordering
Compare two strings in a locale-aware fashion. This is in contrast to the Ord
instance on String
which treats strings as arrays of code units:
"ä" `localeCompare` "b" == LT
"ä" `compare` "b" == GT
#split Source
split :: Pattern -> String -> Array String
Returns the substrings of the second string separated along occurences of the first string.
split (Pattern " ") "hello world" == ["hello", "world"]
#joinWith Source
joinWith :: String -> Array String -> String
Joins the strings in the array together, inserting the first argument as separator between them.
joinWith ", " ["apple", "banana", "orange"] == "apple, banana, orange"