Module string/index
string/index
String and Unicode types.
Types
rune
newtype
rune
Fields
| Name | Type | Description |
|---|---|---|
char | u32 |
Methods
from_u32 : (rune) fn(value : u32) -> Option(rune)to_u32 : (rune) fn(self : rune) -> u32Parameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: u32
is_ascii : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
is_whitespace : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
is_digit : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
is_alphabetic : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
is_uppercase : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
is_lowercase : (rune) fn(self : rune) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: bool
to_lowercase : (rune) fn(self : rune) -> runeParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: rune
to_uppercase : (rune) fn(self : rune) -> runeParameters
| Name | Type | Notes |
|---|---|---|
self | rune |
Returns: rune
String
newtype
String
Fields
| Name | Type | Description |
|---|---|---|
_bytes | Option(ArrayList(u8)) |
Methods
new : (String) fn() -> StringReturns: String
with_capacity : (String) fn(capacity : usize) -> Stringfrom_bytes : (String) fn(bytes : ArrayList(u8)) -> Stringfrom : (String) fn(slice : str) -> Stringfrom_cstr : (String) fn(cstr : *(u8)) -> Result(String, StringError)to_cstr : (String) fn(self : String) -> ArrayList(u8)len : (String) fn(self : String) -> usizeis_empty : (String) fn(self : String) -> boolas_bytes : (String) fn(self : String) -> ArrayList(u8)as_str : (String) fn(self : String) -> str_decode_rune_at : (String) fn(self : String, byte_index : usize) -> Option(rune)at : (String) fn(self : String, index : usize) -> Option(rune)concat : (String) fn(self : String, other : String) -> Stringpush_string : (String) fn(self : String, other : String) -> unitpush_str : (String) fn(self : String, s : str) -> unitpush_byte : (String) fn(self : String, b : u8) -> unitreserve : (String) fn(self : String, additional : usize) -> unitclear : (String) fn(self : String) -> unitbytes_len : (String) fn(self : String) -> usizesubstring : (String) fn(self : String, start : usize, end : usize) -> Stringindex_of : (String) fn(self : String, substr : String, (from_index : usize) ?= 0) -> Option(usize)contains : (String) fn(self : String, substr : String, (from_index : usize) ?= 0) -> boolsplit : (String) fn(self : String, separator : String) -> ArrayList(String)last_index_of : (String) fn(self : String, substr : String, (from_index : usize) ?= (usize.MAX)) -> Option(usize)starts_with : (String) fn(self : String, prefix : String, (position : usize) ?= 0) -> boolends_with : (String) fn(self : String, suffix : String, (end_position : usize) ?= (usize.MAX)) -> boolreplace : (String) fn(self : String, search_value : String, new_value : String) -> Stringreplace_all : (String) fn(self : String, search_value : String, new_value : String) -> Stringto_uppercase : (String) fn(self : String) -> Stringto_lowercase : (String) fn(self : String) -> String_is_whitespace_byte : (String) fn(byte : u8) -> boolParameters
| Name | Type | Notes |
|---|---|---|
byte | u8 |
Returns: bool
trim_start : (String) fn(self : String) -> Stringchars : (String) fn(self : String) -> StringCharsbytes : (String) fn(self : String) -> StringBytesiter : (String) fn(self : String) -> _StringPosIterinto_iter : (String) fn(self : String) -> StringCharslines : (String) fn(self : String) -> StringLinesrepeat : (String) fn(self : String, n : usize) -> Stringjoin : (String) fn(self : String, items : ArrayList(String)) -> String_is_digit_byte : (String) fn(byte : u8) -> boolParameters
| Name | Type | Notes |
|---|---|---|
byte | u8 |
Returns: bool
parse_i32 : (String) fn(self : String) -> Option(i32)parse_i64 : (String) fn(self : String) -> Option(i64)parse_u32 : (String) fn(self : String) -> Option(u32)parse_u64 : (String) fn(self : String) -> Option(u64)
StringError
enum
StringError
Variants
| Variant | Fields | Description |
|---|---|---|
InvalidUtf8 | ||
IndexOutOfBounds | index: usize, length: usize |
StringChars
struct
StringChars
Fields
| Name | Type | Description |
|---|---|---|
_string | String | |
_byte_index | usize |
impl(forall(I : Type), where(I <: Iterator), I)
into_iter : fn(self : I) -> IParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: I
impl(forall(I : Type), where(I <: Iterator), I)
map : fn(forall(comptime(A) : Type, comptime(B) : Type, comptime(F) : Type), self : I, f : F) -> IterMap(I, B, F)filter : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> IterFilter(I, F)take : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterTake(I)skip : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterSkip(I)enumerate : fn(forall(comptime(A) : Type), self : I) -> IterEnumerate(I)zip : fn(forall(comptime(A) : Type, comptime(J) : Type, comptime(B) : Type), self : I, other : J) -> IterZip(I, J)fold : fn(forall(comptime(A) : Type, comptime(Acc) : Type, comptime(F) : Type), self : I, init : Acc, f : F) -> AccParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
init | Acc | |
f | F |
Returns: Acc
for_each : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> unitParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
f | F |
Returns: unit
count : fn(forall(comptime(A) : Type), self : I) -> usizeParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: usize
any : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
all : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
StringBytes
struct
StringBytes
Fields
| Name | Type | Description |
|---|---|---|
_string | String | |
_index | usize |
impl(forall(I : Type), where(I <: Iterator), I)
into_iter : fn(self : I) -> IParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: I
impl(forall(I : Type), where(I <: Iterator), I)
map : fn(forall(comptime(A) : Type, comptime(B) : Type, comptime(F) : Type), self : I, f : F) -> IterMap(I, B, F)filter : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> IterFilter(I, F)take : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterTake(I)skip : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterSkip(I)enumerate : fn(forall(comptime(A) : Type), self : I) -> IterEnumerate(I)zip : fn(forall(comptime(A) : Type, comptime(J) : Type, comptime(B) : Type), self : I, other : J) -> IterZip(I, J)fold : fn(forall(comptime(A) : Type, comptime(Acc) : Type, comptime(F) : Type), self : I, init : Acc, f : F) -> AccParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
init | Acc | |
f | F |
Returns: Acc
for_each : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> unitParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
f | F |
Returns: unit
count : fn(forall(comptime(A) : Type), self : I) -> usizeParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: usize
any : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
all : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
StringLines
struct
StringLines
Fields
| Name | Type | Description |
|---|---|---|
_string | String | |
_byte_index | usize |
impl(forall(I : Type), where(I <: Iterator), I)
into_iter : fn(self : I) -> IParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: I
impl(forall(I : Type), where(I <: Iterator), I)
map : fn(forall(comptime(A) : Type, comptime(B) : Type, comptime(F) : Type), self : I, f : F) -> IterMap(I, B, F)filter : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> IterFilter(I, F)take : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterTake(I)skip : fn(forall(comptime(A) : Type), self : I, n : usize) -> IterSkip(I)enumerate : fn(forall(comptime(A) : Type), self : I) -> IterEnumerate(I)zip : fn(forall(comptime(A) : Type, comptime(J) : Type, comptime(B) : Type), self : I, other : J) -> IterZip(I, J)fold : fn(forall(comptime(A) : Type, comptime(Acc) : Type, comptime(F) : Type), self : I, init : Acc, f : F) -> AccParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
init | Acc | |
f | F |
Returns: Acc
for_each : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, f : F) -> unitParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
f | F |
Returns: unit
count : fn(forall(comptime(A) : Type), self : I) -> usizeParameters
| Name | Type | Notes |
|---|---|---|
self | I |
Returns: usize
any : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
all : fn(forall(comptime(A) : Type, comptime(F) : Type), self : I, pred : F) -> boolParameters
| Name | Type | Notes |
|---|---|---|
self | I | |
pred | F |
Returns: bool
StringBuilder
object
StringBuilder
Fields
| Name | Type | Description |
|---|---|---|
_buf | ArrayList(u8) |
Methods
new : (StringBuilder) fn() -> StringBuilderReturns: StringBuilder
with_capacity : (StringBuilder) fn(capacity : usize) -> StringBuilderlen : (StringBuilder) fn(self : StringBuilder) -> usizeis_empty : (StringBuilder) fn(self : StringBuilder) -> boolwrite_str : (StringBuilder) fn(self : StringBuilder, s : str) -> unitwrite_string : (StringBuilder) fn(self : StringBuilder, s : String) -> unitwrite_byte : (StringBuilder) fn(self : StringBuilder, b : u8) -> unitwrite_rune : (StringBuilder) fn(self : StringBuilder, r : rune) -> unitwrite_line : (StringBuilder) fn(self : StringBuilder, s : String) -> unitto_string : (StringBuilder) fn(self : StringBuilder) -> Stringclear : (StringBuilder) fn(self : StringBuilder) -> unitFunctions
assert_dyn
function