Module
Data.String.Common
- Package
- purescript-strings
- Repository
- purescript/purescript-strings
#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
#replace Source
replace :: Pattern -> Replacement -> String -> String
Replaces the first occurence of the pattern with the replacement string.
replace (Pattern "<=") (Replacement "≤") "a <= b <= c" == "a ≤ b <= c"
#replaceAll Source
replaceAll :: Pattern -> Replacement -> String -> String
Replaces all occurences of the pattern with the replacement string.
replaceAll (Pattern "<=") (Replacement "≤") "a <= b <= c" == "a ≤ b ≤ c"
#trim Source
trim :: String -> String
Removes whitespace from the beginning and end of a string, including whitespace characters and line terminators.
trim " Hello \n World\n\t " == "Hello \n World"
- Modules
- Data.
Char - Data.
Char. Gen - Data.
String - Data.
String. CaseInsensitive - Data.
String. CodePoints - Data.
String. CodeUnits - Data.
String. Common - Data.
String. Gen - Data.
String. NonEmpty - Data.
String. NonEmpty. CaseInsensitive - Data.
String. NonEmpty. CodePoints - Data.
String. NonEmpty. CodeUnits - Data.
String. NonEmpty. Internal - Data.
String. Pattern - Data.
String. Regex - Data.
String. Regex. Flags - Data.
String. Regex. Unsafe - Data.
String. Unsafe