Documentation

Init.Data.String.Extra

Interpret the string as the decimal representation of a natural number.

Panics if the string is not a string of digits.

Equations
  • One or more equations did not get rendered due to their size.
@[extern lean_string_from_utf8_unchecked]

Convert a UTF-8 encoded ByteArray string to String. The result is unspecified if a is not properly UTF-8 encoded.

@[extern lean_string_to_utf8]

Convert the given String to a UTF-8 encoded byte array.

@[simp]
theorem String.pos_lt_eq (p₁ : String.Pos) (p₂ : String.Pos) :
(p₁ < p₂) = (p₁.byteIdx < p₂.byteIdx)
@[simp]
theorem String.pos_add_char (p : String.Pos) (c : Char) :
(p + c).byteIdx = p.byteIdx + String.csize c
theorem String.eq_empty_of_bsize_eq_zero {s : String} (h : String.endPos s = { byteIdx := 0 }) :
s = ""
theorem String.lt_next (s : String) (i : String.Pos) :
i.byteIdx < (String.next s i).byteIdx
@[specialize #[]]

Advance the given iterator until the predicate returns true or the end of the string is reached.

Equations
@[specialize #[]]
def String.Iterator.foldUntil {α : Type u_1} (it : String.Iterator) (init : α) (f : αCharOption α) :
Equations
  • One or more equations did not get rendered due to their size.