Equations
- String.instInhabited = { default := "" }
@[extern lean_string_push]
Adds a character to the end of a string.
The internal implementation uses dynamic arrays and will perform destructive updates if the string is not shared.
Examples:
Instances For
@[inline]
Returns a new string that contains only the character c
.
Because strings are encoded in UTF-8, the resulting string may take multiple bytes.
Examples:
String.singleton 'L' = "L"
String.singleton ' ' = " "
String.singleton '"' = "\""
String.singleton '𝒫' = "𝒫"
Equations
- String.singleton c = "".push c
Instances For
@[extern lean_string_offsetofpos]
@[extern lean_string_dropright]
@[extern lean_substring_extract]
@[extern lean_substring_prev]
@[inline]
Constructs a singleton string that contains only the provided character.
Examples: