The areas / V33. Data structures and computation
Mathlib.Data.String.Defs
7 declarations. Mathlib docs · Source
def String.leftpad E1 #
ℕ → optParam Char ' ' → String → String
Pad s : String with repeated occurrences of c : Char until it's of length n.
If s is initially larger than n, just return s.
def String.replicate E1 #
ℕ → Char → String
Construct the string consisting of n copies of the character c.
def String.rightpad E1 #
ℕ → optParam Char ' ' → String → String
Pad s : String with repeated occurrences of c : Char on the right until it's of length n.
If s is initially larger than n, just return s.
def String.IsPrefix E1 #
String → String → Prop
s.IsPrefix t checks if the string s is a prefix of the string t.
def String.IsSuffix E1 #
String → String → Prop
s.IsSuffix t checks if the string s is a suffix of the string t.
def String.mapTokens E1 #
Char → (String → String) → String → String
String.mapTokens c f s tokenizes s : string on c : char, maps f over each token, and
then reassembles the string by intercalating the separator token c over the mapped tokens.
def String.head E1 #
String → Char
Produce the head character from the string s, if s is not empty, otherwise 'A'.