Std.Text
66 public declarations
- allChars
Str -> fn(Char) -> Bool -> BoolWhether every character satisfies the predicate. True for empty text.
- anyChar
Str -> fn(Char) -> Bool -> BoolWhether any character satisfies the predicate. False for empty text.
- at
Str -> Int -> Option[Char]The character at a position, or `None` when there is none.
- before
Str -> Str -> BoolWhether one text sorts before another.
- breakOn
Str -> Str -> (Str, Str)The text before the first occurrence of a needle, and the rest including it.
- breakOnEnd
Str -> Str -> (Str, Str)The text after the last occurrence of a needle, and everything before it.
- capitalize
Str -> StrText with its first character in upper case and the rest unchanged.
- center
Str -> Int -> Str -> StrText padded on both sides to at least `width` characters.
- chunksOf
Str -> Int -> Array[Str]The text in pieces of at most `size` characters.
- commonPrefix
Str -> Str -> (Str, Str, Str)The longest text both begin with, and what remains of each after it.
- compare
Str -> Str -> IntTwo texts compared without materialising the comparison as a number.
- cons
Char -> Str -> StrA character placed before some text.
- countChars
Str -> fn(Char) -> Bool -> IntHow many characters satisfy the predicate.
- countOccurrences
Str -> Str -> IntHow many times a needle occurs, without overlapping.
- countOf
Str -> Option[Int]The count this text spells, or nothing.
- drop
Str -> Int -> StrEvery character after the first `skipped`.
- dropAround
Str -> fn(Char) -> Bool -> StrLeading and trailing characters the predicate accepts removed.
- dropEnd
Str -> Int -> StrEvery character but the last `skipped`.
- dropWhile
Str -> fn(Char) -> Bool -> StrEverything after the longest leading run the predicate accepts.
- dropWhileEnd
Str -> fn(Char) -> Bool -> StrTrailing characters the predicate accepts removed.
- equalsIgnoreCase
Str -> Str -> BoolWhether two texts are equal ignoring case.
- filterChars
Str -> fn(Char) -> Bool -> StrOnly the characters the predicate accepts.
- find
Str -> Str -> Option[Int]The position of the first occurrence, or `None` when there is none.
- findChar
Str -> fn(Char) -> Bool -> Option[Char]The first character the predicate accepts, or `None`.
- findIndex
Str -> fn(Char) -> Bool -> Option[Int]The position of the first character the predicate accepts, or `None`.
- flatMapChars
Str -> fn(Char) -> Str -> StrEvery character transformed into text, and that text joined.
- foldChars
Str -> fn(A, Char) -> A -> A -> AEvery character folded into one value, left to right.
- foldCharsRight
Str -> fn(Char, A) -> A -> A -> AEvery character folded into one value, right to left.
- fromChars
&Array[Char] -> StrText rebuilt from characters.
- fromLines
&Array[Str] -> StrLines joined with newlines between them.
- fromWords
&Array[Str] -> StrWords joined with single spaces between them.
- groupChars
Str -> Array[Str]Runs of adjacent equal characters, as text.
- head
Str -> Option[Char]The first character, or `None` for empty text.
- initial
Str -> StrEverything but the last character.
- isBlank
Str -> BoolWhether text contains only whitespace, or nothing at all.
- join
&Array[Str] -> Str -> StrEvery piece joined with a separator between them.
- last
Str -> Option[Char]The last character, or `None` for empty text.
- mapChars
Str -> fn(Char) -> Char -> StrEvery character transformed.
- padLeft
Str -> Int -> Str -> StrText padded on the left to at least `width` characters.
- padRight
Str -> Int -> Str -> StrText padded on the right to at least `width` characters.
- partition
Str -> fn(Char) -> Bool -> (Str, Str)The characters the predicate accepts, and the characters it rejects.
- prefixes
Str -> Array[Str]Every prefix, shortest first.
- rest
Str -> StrEverything but the first character. Empty text answers empty text.
- scanChars
Str -> fn(A, Char) -> A -> A -> Array[A]Every running result of folding the characters.
- singleton
Char -> StrText of exactly one character.
- snoc
Str -> Char -> StrA character placed after some text.
- span
Str -> fn(Char) -> Bool -> (Str, Str)The longest leading run the predicate accepts, and the rest.
- splitAt
Str -> Int -> (Str, Str)The text split at a position.
- splitNonEmpty
Str -> Str -> Array[Str]The pieces of text separated by a separator, with empty pieces removed.
- stripPrefix
Str -> Str -> StrText with a prefix removed, or unchanged when it is not there.
- stripSuffix
Str -> Str -> StrText with a suffix removed, or unchanged when it is not there.
- suffixes
Str -> Array[Str]Every suffix, longest first.
- take
Str -> Int -> StrThe first `wanted` characters, or the whole text when it is shorter.
- takeEnd
Str -> Int -> StrThe last `wanted` characters, or the whole text when it is shorter.
- takeWhile
Str -> fn(Char) -> Bool -> StrThe longest leading run of characters the predicate accepts.
- toChars
Str -> Array[Char]Every character, as an array.
- toLines
Str -> Array[Str]Every line, with a trailing newline producing no final empty line.
- toTitle
Str -> StrThe title-case form: the first character of each word in upper case.
- trimEnd
Str -> StrWhitespace removed from the end.
- trimStart
Str -> StrWhitespace removed from the start.
- uncons
Str -> Option[(Char, Str)]The first character and the rest, or `None` for empty text.
- unfold
Int -> S -> fn(S) -> Option[(Char, S)] -> StrText grown from a seed until the step answers `None`.
- unsnoc
Str -> Option[(Str, Char)]Everything but the last character and that character, or `None` when empty.
- wholeOf
Str -> Option[Int]The whole number this text spells, or nothing.
- words
Str -> Array[Str]Every word, splitting on single spaces and discarding empty pieces.
- zipChars
Str -> Str -> Array[(Char, Char)]The characters of two texts paired, stopping at the shorter.
