File: .lake/packages/lean4/src/lean/Init/Data/String/Extra.lean

full_name: String.toNat!
code: /-- Interpret the string as the decimal representation of a natural number.

Panics if the string is not a string of digits. -/
def toNat! (s : String) : Nat 
goal: Nat

full_name: String.utf8DecodeChar?
code: def utf8DecodeChar? (a : ByteArray) (i : Nat) : Option Char 
goal: Option Char

full_name: String.validateUTF8.loop
code: /-- Returns true if the given byte array consists of valid UTF-8. -/
@[extern "lean_string_validate_utf8"]
def validateUTF8 (a : @& ByteArray) : Bool 
goal: Option Unit

full_name: String.validateUTF8
code: /-- Returns true if the given byte array consists of valid UTF-8. -/
@[extern "lean_string_validate_utf8"]
def validateUTF8 (a : @& ByteArray) : Bool 
goal: Bool

full_name: String.fromUTF8
code: /-- Converts a [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoded `ByteArray` string to `String`. -/
@[extern "lean_string_from_utf8_unchecked"]
def fromUTF8 (a : @& ByteArray) (h : validateUTF8 a) : String 
goal: String

full_name: String.fromUTF8.loop
code: /-- Converts a [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoded `ByteArray` string to `String`. -/
@[extern "lean_string_from_utf8_unchecked"]
def fromUTF8 (a : @& ByteArray) (h : validateUTF8 a) : String 
goal: String

full_name: String.fromUTF8?
code: /-- Converts a [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoded `ByteArray` string to `String`,
or returns `none` if `a` is not properly UTF-8 encoded. -/
@[inline] def fromUTF8? (a : ByteArray) : Option String 
goal: Option String

full_name: String.fromUTF8!
code: /-- Converts a [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoded `ByteArray` string to `String`,
or panics if `a` is not properly UTF-8 encoded. -/
@[inline] def fromUTF8! (a : ByteArray) : String 
goal: String

full_name: String.utf8EncodeChar
code: def utf8EncodeChar (c : Char) : List UInt8 
goal: List UInt8

full_name: String.length_utf8EncodeChar
code: @[simp] theorem length_utf8EncodeChar (c : Char) : (utf8EncodeChar c).length = c.utf8Size 
goal: (String.utf8EncodeChar c).length = c.utf8Size

full_name: String.toUTF8
code: /-- Converts the given `String` to a [UTF-8](https://en.wikipedia.org/wiki/UTF-8) encoded byte array. -/
@[extern "lean_string_to_utf8"]
def toUTF8 (a : @& String) : ByteArray 
goal: ByteArray

full_name: String.size_toUTF8
code: @[simp] theorem size_toUTF8 (s : String) : s.toUTF8.size = s.utf8ByteSize 
goal: s.toUTF8.size = s.utf8ByteSize

full_name: String.getUtf8Byte
code: /-- Accesses a byte in the UTF-8 encoding of the `String`. O(1) -/
@[extern "lean_string_get_byte_fast"]
def getUtf8Byte (s : @& String) (n : Nat) (h : n < s.utf8ByteSize) : UInt8 
goal: UInt8

full_name: String.Iterator.sizeOf_next_lt_of_hasNext
code: theorem Iterator.sizeOf_next_lt_of_hasNext (i : String.Iterator) (h : i.hasNext) : sizeOf i.next < sizeOf i 
goal: sizeOf i.next < sizeOf i

full_name: String.«_aux_.lake_packages_lean4_src_lean_Init_Data_String_Extra___macroRules_tacticDecreasing_trivial_1»
code: macro_rules
| `(tactic| decreasing_trivial) =>
  `(tactic| with_reducible apply String.Iterator.sizeOf_next_lt_of_hasNext; assumption)
goal: Lean.Macro

full_name: String.Iterator.sizeOf_next_lt_of_atEnd
code: theorem Iterator.sizeOf_next_lt_of_atEnd (i : String.Iterator) (h : ¬ i.atEnd = true) : sizeOf i.next < sizeOf i 
goal: sizeOf i.next < sizeOf i

full_name: String.«_aux_.lake_packages_lean4_src_lean_Init_Data_String_Extra___macroRules_tacticDecreasing_trivial_2»
code: macro_rules
| `(tactic| decreasing_trivial) =>
  `(tactic| with_reducible apply String.Iterator.sizeOf_next_lt_of_atEnd; assumption)
goal: Lean.Macro

full_name: String.Iterator.find
code: /-- Advance the given iterator until the predicate returns true or the end of the string is reached. -/
@[specialize] def find (it : Iterator) (p : Char → Bool) : Iterator 
goal: String.Iterator

full_name: String.Iterator.foldUntil
code: @[specialize] def foldUntil (it : Iterator) (init : α) (f : α → Char → Option α) : α × Iterator 
goal: α × String.Iterator

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.findLeadingSpacesSize.findNextLine
code: private def findLeadingSpacesSize (s : String) : Nat 
goal: Nat

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.findLeadingSpacesSize.consumeSpaces
code: private def findLeadingSpacesSize (s : String) : Nat 
goal: Nat

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.findLeadingSpacesSize
code: private def findLeadingSpacesSize (s : String) : Nat 
goal: Nat

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.removeNumLeadingSpaces.consumeSpaces
code: private def removeNumLeadingSpaces (n : Nat) (s : String) : String 
goal: Nat → String.Iterator → String → String

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.removeNumLeadingSpaces.saveLine
code: private def removeNumLeadingSpaces (n : Nat) (s : String) : String 
goal: String

full_name: _private.«.lake».packages.lean4.src.lean.Init.Data.String.Extra.0.String.removeNumLeadingSpaces
code: private def removeNumLeadingSpaces (n : Nat) (s : String) : String 
goal: String

full_name: String.removeLeadingSpaces
code: def removeLeadingSpaces (s : String) : String 
goal: String

full_name: String.crlfToLf.go
code: /--
Replaces each `\r\n` with `\n` to normalize line endings,
but does not validate that there are no isolated `\r` characters.
It is an optimized version of `String.replace text "\r\n" "\n"`.
-/
def crlfToLf (text : String) : String 
goal: String

full_name: String.crlfToLf
code: /--
Replaces each `\r\n` with `\n` to normalize line endings,
but does not validate that there are no isolated `\r` characters.
It is an optimized version of `String.replace text "\r\n" "\n"`.
-/
def crlfToLf (text : String) : String 
goal: String