A string that cannot be empty. The head and tail can be accessed without Maybes. Most other string functions are available.
Create a nonempty string from an ordinary string, failing on the empty string.
Take a substring given a start and end index. Negative indexes are taken starting from the end of the list.
text = Nonempty 's' "nakes on a plane!"
slice 7 9 text == "on"
slice 0 6 text == "snakes"
slice 0 -7 text == "snakes on a"
slice -6 -1 text == "plane"See if the second string starts with the first one.
Get all of the indexes for a substring in another string.
indexes "i" (Nonempty 'M' "ississippi") == [ 1, 4, 7, 10 ]
indexes "ss" (Nonempty 'M' "ississippi") == [ 2, 5 ]Try to convert a string into an int, failing on improperly formatted nonempty strings.
Try to convert a string into a float, failing on improperly formatted nonempty strings.
Split a nonempty string into its head and tail. This lets you pattern match on strings exactly as you would with lists.
Convert a nonempty string to a nonempty list of characters.
Convert a nonempty list of characters into a nonempty string.
Cosmetic operations such as padding with extra characters or trimming whitespace.
Convert a string to all upper case. Useful for case-insensitive comparisons and VIRTUAL YELLING.
Convert a string to all lower case. Useful for case-insensitive comparisons.
Pad a nonempty string on both sides until it has a given length.
Pad a nonempty string on the left until it has a given length.
Pad a nonempty string on the right until it has a given length.
A string with at least one character.