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.
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      @[extern lean_string_validate_utf8]

      Returns true if the given byte array consists of valid UTF-8.

      Equations
      Instances For
        Equations
        Instances For
          @[extern lean_string_from_utf8]

          Converts a UTF-8 encoded ByteArray string to String.

          Equations
          Instances For
            Equations
            Instances For
              @[inline]

              Converts a UTF-8 encoded ByteArray string to String, or returns none if a is not properly UTF-8 encoded.

              Equations
              Instances For
                @[inline]

                Converts a UTF-8 encoded ByteArray string to String, or panics if a is not properly UTF-8 encoded.

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

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

                    Equations
                    Instances For
                      @[simp]
                      theorem String.size_toUTF8 (s : String) :
                      s.toUTF8.size = s.utf8ByteSize
                      @[extern lean_string_get_byte_fast]
                      def String.getUtf8Byte (s : String) (n : Nat) (h : n < s.utf8ByteSize) :

                      Accesses a byte in the UTF-8 encoding of the String. O(1)

                      Equations
                      • s.getUtf8Byte n h = s.toUTF8.get n,
                      Instances For
                        @[specialize #[]]

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

                        Equations
                        • it.find p = if it.atEnd = true then it else if p it.curr = true then it else it.next.find p
                        Instances For
                          @[specialize #[]]
                          def String.Iterator.foldUntil {α : Type u_1} (it : String.Iterator) (init : α) (f : αCharOption α) :
                          Equations
                          • it.foldUntil init f = if it.atEnd = true then (init, it) else match f init it.curr with | some a => it.next.foldUntil a f | x => (init, it)
                          Instances For
                            Equations
                            Instances For