Documentation

Init.Data.String.Extra

def String.toNat! (s : String) :
Equations
@[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]
constant String.toUTF8 (a : String) :
@[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