Submodules
Constants
Procedures
at

Returns a new string, only containing the code point at the index index in the string s. If index is negative, the length of s is added to it.

Arguments

s - str

index - int

Returns

str

codepoint_at

Returns a non-negative integer that is the unicode code point at the given index. If index is negative, the length of s will be added to it.

Arguments

s - str

index - int

Returns

int

ends_with

Returns true if the end of s fully matches prefix.

Arguments

s - str

suffix - str

Returns

bool

find

Finds all occurances of sub in s, returning an iterator over the indices of the first code points of the occurances of sub.

Arguments

s - str

sub - str

Returns

|| -> ( #next int | #end unit | ... )

fmt

Returns a copy of s, replacing underscores in s with the corresponding elements in v. If the number of underscores in s is less than the number of elements in v, a panic will be triggered. Underscores for which there is no corresponding element in v will simply be left untouched.

Arguments

s - str

v - [str]

Returns

str

from_codepoints

Returns a string constructed from the given sequence of code points.

Arguments

cps - [int]

Returns

str

iter

Returns an iterator over all code points in s.

Arguments

s - str

Returns

|| -> ( #next str | #end unit | ... )

join

Joins the strings provided by the iterator strings into a single string, inserting sep inbetween joined strings.

Arguments

strings - || -> ( #next str | #end any )

sep - str

Returns

str

pad_left

Returns a new string with a minimum length of target_length, padded by repeating padding as many times as needed and appending it to the end of s. This means that if padding is more than one code point long, the returned string may be longer than target_length.

Arguments

s - str

target_length - int

padding - str

Returns

str

pad_right

Returns a new string with a minimum length of target_length, padded by repeating padding as many times as needed and inserting it before the start of s. This means that if padding is more than one code point long, the returned string may be longer than target_length.

Arguments

s - str

target_length - int

padding - str

Returns

str

parse_flt

Attempts to parse source as a float.

Arguments

source - str

Returns

( #some float | #none unit | ... )

parse_int

Attempts to parse source as an integer.

Arguments

source - str

Returns

( #some int | #none unit | ... )

repeat

Returns repeated repeated times times.

Arguments

repeated - str

times - int

Returns

str

replace

Returns src, replacing all occurances of replaced in src with replacement.

Arguments

src - str

replaced - str

replacement - str

Returns

str

split

Splits s into parts separated by occurances of sep, returning an iterator over each part.

Arguments

s - str

sep - str

Returns

|| -> ( #next str | #end unit | ... )

starts_with

Returns true if the beginning of s fully matches prefix.

Arguments

s - str

prefix - str

Returns

bool

substring_after

Returns the part of the string s starting at the index start_index up to the end of the string. If start_index is negative, the length of s is added to it.

Arguments

s - str

start_index - int

Returns

str

substring_until

Returns the part of the string s starting at the index 0 up to (not including) the index end_index. If end_index is negative, the length of s is added to it.

Arguments

s - str

end_index - int

Returns

str