clampNat : Int -> Nat
import nécessaire.Extended string operations
Synopsis
clampNat : Int -> NattakeCs : Int -> List Char -> List ChardropCs : Int -> List Char -> List Charslice : Int -> Int -> String -> Stringsubstring : Int -> Int -> String -> StringstartsWith : String -> String -> BoolendsWith : String -> String -> Boolcontains : String -> String -> BoolindexOf : String -> String -> Maybe IntidxGo : List Char -> List Char -> Int -> Maybe Intrepeat : Int -> String -> StringpadLeft : Int -> Char -> String -> StringpadRight : Int -> Char -> String -> Stringreplace : String -> String -> String -> StringreplaceGo : List Char -> List Char -> List Char -> List CharsplitOn : String -> String -> List StringsplitGo : List Char -> List Char -> List Char -> List (List Char)
takeCs : Int -> List Char -> List Char
dropCs : Int -> List Char -> List Char
slice : Int -> Int -> String -> String
The code points in the half-open range [start, end), with start and end clamped to the string's bounds: String.slice 1 4 "abcdef" = "bcd", String.slice (0 - 5) 2 "abc" = "ab".
substring : Int -> Int -> String -> String
len code points starting at start: String.substring 2 3 "abcdef" = "cde". Equal to slice start (start + len).
startsWith : String -> String -> Bool
Does the string start with prefix?
endsWith : String -> String -> Bool
Does the string end with suffix?
contains : String -> String -> Bool
Does the string contain needle as a substring?
indexOf : String -> String -> Maybe Int
The code-point index of the first occurrence of needle, or Nothing. The empty needle is found at index 0.
idxGo : List Char -> List Char -> Int -> Maybe Int
repeat : Int -> String -> String
n copies of the string concatenated (empty if n ≤ 0): String.repeat 3 "ab" = "ababab".
padLeft : Int -> Char -> String -> String
Pad on the LEFT with fill up to at least width code points (returns the string unchanged if it is already that wide): String.padLeft 5 '0' "42" = "00042".
padRight : Int -> Char -> String -> String
Pad on the RIGHT with fill up to at least width code points.
replace : String -> String -> String -> String
Replace every non-overlapping occurrence of old with new. An empty old leaves the string unchanged. String.replace "ab" "X" "abcab" = "XcX".
replaceGo : List Char -> List Char -> List Char -> List Char
splitOn : String -> String -> List String
Split on a (possibly multi-character) separator, keeping empty chunks: String.splitOn ", " "a, b, c" = ["a", "b", "c"], String.splitOn ":" "a::b" = ["a", "", "b"]. An empty separator yields the whole string as one chunk.
splitGo : List Char -> List Char -> List Char -> List (List Char)