clampNat : Int -> Nat
import nécessaire.Opérations String étendues
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
Les points de code dans l'intervalle semi-ouvert [start, end), avec start et end ramenés aux bornes de la chaîne : String.slice 1 4 "abcdef" = "bcd", String.slice (0 - 5) 2 "abc" = "ab".
substring : Int -> Int -> String -> String
len points de code à partir de start : String.substring 2 3 "abcdef" = "cde". Égal à slice start (start + len).
startsWith : String -> String -> Bool
La chaîne commence-t-elle par prefix ?
endsWith : String -> String -> Bool
La chaîne se termine-t-elle par suffix ?
contains : String -> String -> Bool
La chaîne contient-elle needle comme sous-chaîne ?
indexOf : String -> String -> Maybe Int
L'indice (en points de code) de la première occurrence de needle, ou Nothing. Le motif vide est trouvé à l'indice 0.
idxGo : List Char -> List Char -> Int -> Maybe Int
repeat : Int -> String -> String
n copies de la chaîne concaténées (vide si n ≤ 0) : String.repeat 3 "ab" = "ababab".
padLeft : Int -> Char -> String -> String
Complète à GAUCHE avec fill jusqu'à au moins width points de code (renvoie la chaîne inchangée si elle est déjà aussi large) : String.padLeft 5 '0' "42" = "00042".
padRight : Int -> Char -> String -> String
Complète à DROITE avec fill jusqu'à au moins width points de code.
replace : String -> String -> String -> String
Remplace chaque occurrence non chevauchante de old par new. Un old vide laisse la chaîne inchangée. String.replace "ab" "X" "abcab" = "XcX".
replaceGo : List Char -> List Char -> List Char -> List Char
splitOn : String -> String -> List String
Découpe selon un séparateur (éventuellement multi-caractère), en gardant les fragments vides : String.splitOn ", " "a, b, c" = ["a", "b", "c"], String.splitOn ":" "a::b" = ["a", "", "b"]. Un séparateur vide rend la chaîne entière comme unique fragment.
splitGo : List Char -> List Char -> List Char -> List (List Char)