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) -> StringBytesinto_iter : (String) fn(self : String) -> StringChars_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
StringBytes
struct