builtin

f32_max #

fn f32_max(a, b f32) f32

compare_f32 #

fn compare_f32(a, b &f32) int

compare_f32 for []f32 sort_with_compare() ref. compare_i64(...)

compare_f64 #

fn compare_f64(a, b &f64) int

compare_f64 for []f64 sort_with_compare() ref. compare_i64(...)

compare_i64 #

fn compare_i64(a, b &i64) int

compare_i64 for []f64 sort_with_compare() sort []i64 with quicksort usage : mut x := [i64(100),10,70,28,92] x.sort_with_compare(compare_i64) println(x) // Sorted i64 Array output: [10, 28, 70, 92, 100]

compare_strings #

fn compare_strings(a, b &string) int

copy #

fn copy(dst, src []byte) int

copy copies the src byte array elements to the dst byte array. The number of the elements copied is the minimum of the length of both arrays. Returns the number of elements copied. TODO: implement for all types

cstring_to_vstring #

fn cstring_to_vstring(cstr byteptr) string

cstring_to_vstring creates a copy of cstr and turns it into a v string

eprint #

fn eprint(s string)

eprintln #

fn eprintln(s string)

error #

fn error(s string) Option

error_with_code #

fn error_with_code(s string, code int) Option

exit #

fn exit(code int)

f32_abs #

fn f32_abs(a f32) f32

----- C functions -----

f32_min #

fn f32_min(a, b f32) f32

f64_max #

fn f64_max(a, b f64) f64

free #

fn free(ptr voidptr)

is_atty #

fn is_atty(fd int) int

isnil #

fn isnil(v voidptr) bool

isnil returns true if an object is nil (only for C objects).

malloc #

fn malloc(n int) byteptr

memdup #

fn memdup(src voidptr, sz int) voidptr

panic #

fn panic(s string)

print #

fn print(s string)

println #

fn println(s string)

proc_pidpath #

fn proc_pidpath(arg_1 int, arg_2 voidptr, arg_3 int) int

ptr_str #

fn ptr_str(ptr voidptr) string

----- value to string functions -----

string_from_wide #

fn string_from_wide(_wstr &u16) string

string_from_wide2 #

fn string_from_wide2(_wstr &u16, len int) string

tos #

fn tos(s byteptr, len int) string

Converts a C string to a V string. String data is reused, not copied.

tos2 #

fn tos2(s byteptr) string

Same as tos, but calculates the length. Called by string(bytes) casts. Used only internally.

tos3 #

fn tos3(s charptr) string

Same as tos2, but for char*, to avoid warnings

tos_clone #

fn tos_clone(s byteptr) string

tos_lit #

fn tos_lit(s charptr) string

utf32_to_str #

fn utf32_to_str(code u32) string

Convert utf32 to utf8 utf32 == Codepoint

utf32_to_str_no_malloc #

fn utf32_to_str_no_malloc(code u32, buf voidptr) string

utf8_char_len #

fn utf8_char_len(b byte) int

utf8_getchar #

fn utf8_getchar() int

Reads an utf8 character from standard input

v_calloc #

fn v_calloc(n int) byteptr

v_realloc #

fn v_realloc(b byteptr, n u32) byteptr

#include <malloc/malloc.h> fn malloc_size(b byteptr) int

vcalloc #

fn vcalloc(n int) byteptr

vstrlen #

fn vstrlen(s byteptr) int

string.i64 #

fn (s string) i64() i64

i64.hex #

fn (nn i64) hex() string

i64.str #

fn (nn i64) str() string

SortedMap.delete #

fn (mut m SortedMap) delete(key string)

array.delete #

fn (mut a array) delete(i int)

array.delete deletes array element at the given index

map.delete #

fn (mut m map) delete(key string)

Removes the mapping of a particular key from the map.

f64.strsci #

fn (x f64) strsci(digit_num int) string

return a string of the input f64 in scientific notation with digit_num deciamals displayed, max 17 digits

f32.strsci #

fn (x f32) strsci(digit_num int) string

return a string of the input f32 in scientific notation with digit_num deciamals displayed, max 8 digits

ustring.add #

fn (u ustring) add(a ustring) ustring

string.after #

fn (s string) after(dot string) string

string.after_char #

fn (s string) after_char(dot byte) string

string.all_after #

fn (s string) all_after(dot string) string

string.all_after_last #

fn (s string) all_after_last(dot string) string

string.all_before #

fn (s string) all_before(dot string) string

all_before('23:34:45.234', '.') == '23:34:45'

string.all_before_last #

fn (s string) all_before_last(dot string) string

ustring.at #

fn (u ustring) at(idx int) string

string.bool #

fn (s string) bool() bool

bool.str #

fn (b bool) str() string

string.bytes #

fn (s string) bytes() []byte

[]byte.bytestr #

fn (b []byte) bytestr() string

TODO remove this once runes are implemented

string.capitalize #

fn (s string) capitalize() string

array.clear #

fn (mut a array) clear()

clears the array without deallocating the allocated data

DenseArray.clone #

fn (d DenseArray) clone() DenseArray

array.clone #

fn (a &array) clone() array

array.clone returns an independent copy of a given array

[]byte.clone #

fn (b []byte) clone() []byte

map.clone #

fn (m map) clone() map

string.clone #

fn (a string) clone() string

ustring.substr #

fn (u ustring) substr(_start, _end int) string

string.substr #

fn (s string) substr(start, end int) string

string.title #

fn (s string) title() string

string.to_lower #

fn (s string) to_lower() string

TODO only works with ASCII

string.contains #

fn (s string) contains(substr string) bool

[]byte.contains #

fn (a []byte) contains(val byte) bool

TODO generic

[]u64.contains #

fn (a []u64) contains(val u64) bool

TODO generic

string.contains_any #

fn (s string) contains_any(chars string) bool

string.contains_any_substr #

fn (s string) contains_any_substr(substrs []string) bool

string.to_upper #

fn (s string) to_upper() string

string.count #

fn (s string) count(substr string) int

counts occurrences of substr in s

ustring.count #

fn (u ustring) count(substr ustring) int

counts occurrences of substr in s

string.ends_with #

fn (s string) ends_with(p string) bool

string.utf32_code #

fn (_rune string) utf32_code() int

Convert utf8 to utf32

[]string.eq #

fn (a1 []string) eq(a2 []string) bool

array_eq checks if two arrays contain all the same elements in the same order. []int == []int (also for: i64, f32, f64, byte, string)

f64.eq_epsilon #

fn (a f64) eq_epsilon(b f64) bool

f32.eq_epsilon #

fn (a f32) eq_epsilon(b f32) bool

byteptr.vstring #

fn (bp byteptr) vstring() string

byteptr.vstring() - converts a C style string to a V string. NB: the string data is reused, NOT copied.

byteptr.vstring_with_len #

fn (bp byteptr) vstring_with_len(len int) string

byteptr.vstring_with_len() - converts a C style string to a V string. NB: the string data is reused, NOT copied.

string.f32 #

fn (s string) f32() f32

f32.eq_epsilon #

fn (a f32) eq_epsilon(b f32) bool

f32.str #

fn (x f32) str() string

----- f32 to string functions ----- str return a f32 as string in suitable notation

f32.strlong #

fn (x f32) strlong() string

return a decimal notation of the input f32

f32.strsci #

fn (x f32) strsci(digit_num int) string

return a string of the input f32 in scientific notation with digit_num deciamals displayed, max 8 digits

array.trim #

fn (mut a array) trim(index int)

trims the array length to "index" without modifying the allocated data. If "index" is greater than len nothing will be changed

string.trim #

fn (s string) trim(cutset string) string

string.f64 #

fn (s string) f64() f64

f64.eq_epsilon #

fn (a f64) eq_epsilon(b f64) bool

f64.str #

fn (x f64) str() string

----- f64 to string functions ----- str return a f64 as string in suitable notation

f64.strlong #

fn (x f64) strlong() string

return a decimal notation of the input f64

f64.strsci #

fn (x f64) strsci(digit_num int) string

return a string of the input f64 in scientific notation with digit_num deciamals displayed, max 17 digits

string.trim_left #

fn (s string) trim_left(cutset string) string

string.fields #

fn (s string) fields() []string

string.filter #

fn (s string) filter(func anon_fn_9_16) string

string.find_between #

fn (s string) find_between(start, end string) string

'hey [man] how you doin' find_between('[', ']') == 'man'

array.first #

fn (a array) first() voidptr

array.first returns the first element of the array

string.trim_prefix #

fn (s string) trim_prefix(str string) string

map.free #

fn (m &map) free()

SortedMap.free #

fn (mut m SortedMap) free()

array.free #

fn (a &array) free()

pub fn (a []int) free() {

string.free #

fn (s &string) free()

string.hash #

fn (s string) hash() int

int.hex #

fn (nn int) hex() string

i64.hex #

fn (nn i64) hex() string

any_int.hex #

fn (nn any_int) hex() string

[]byte.hex #

fn (b []byte) hex() string

[]byte.hex returns a string with the hexadecimal representation of the byte elements of the array

u32.hex #

fn (nn u32) hex() string

i16.hex #

fn (nn i16) hex() string

u16.hex #

fn (nn u16) hex() string

i8.hex #

fn (nn i8) hex() string

byte.hex #

fn (nn byte) hex() string

u64.hex #

fn (nn u64) hex() string

int.hex2 #

fn (n int) hex2() string

string.i16 #

fn (s string) i16() i16

i16.hex #

fn (nn i16) hex() string

i16.str #

fn (n i16) str() string

string.to_wide #

fn (_str string) to_wide() &u16

string.i8 #

fn (s string) i8() i8

i8.hex #

fn (nn i8) hex() string

i8.str #

fn (n i8) str() string

[]char.index #

fn (a []char) index(v char) int

[]char.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array. TODO is char type yet in the language?

string.index #

fn (s string) index(p string) ?int

[]int.index #

fn (a []int) index(v int) int

[]int.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

[]byte.index #

fn (a []byte) index(v byte) int

[]byte.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

[]string.index #

fn (a []string) index(v string) int

[]string.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

ustring.index_after #

fn (u ustring) index_after(p ustring, start int) int

string.index_after #

fn (s string) index_after(p string, start int) int

string.index_any #

fn (s string) index_any(chars string) int

string.index_byte #

fn (s string) index_byte(c byte) int

string.index_old #

fn (s string) index_old(p string) int

array.insert #

fn (mut a array) insert(i int, val voidptr)

array.insert

array.insert_many #

fn (mut a array) insert_many(i int, val voidptr, size int)

array.insert_many

string.int #

fn (s string) int() int

int.hex #

fn (nn int) hex() string

int.hex2 #

fn (n int) hex2() string

int.str #

fn (n int) str() string

int.str_l #

fn (nn int) str_l(max int) string

This implementation is the quickest with gcc -O2

string.trim_right #

fn (s string) trim_right(cutset string) string

byte.is_bin_digit #

fn (c byte) is_bin_digit() bool

byte.is_capital #

fn (c byte) is_capital() bool

string.is_capital #

fn (s string) is_capital() bool

byte.is_digit #

fn (c byte) is_digit() bool

byte.is_hex_digit #

fn (c byte) is_hex_digit() bool

byte.is_letter #

fn (c byte) is_letter() bool

string.is_lower #

fn (s string) is_lower() bool

byte.is_oct_digit #

fn (c byte) is_oct_digit() bool

byte.is_space #

fn (c byte) is_space() bool

string.is_title #

fn (s string) is_title() bool

string.is_upper #

fn (s string) is_upper() bool

string.trim_space #

fn (s string) trim_space() string

[]string.join #

fn (a []string) join(del string) string

fn (s []string) substr(a, b int) string { return join_strings(s.slice_fast(a, b)) }

[]string.join_lines #

fn (s []string) join_lines() string

SortedMap.keys #

fn (m &SortedMap) keys() []string

map.keys #

fn (m &map) keys() []string

Returns all keys in the map. TODO: add optimization in case of no deletes

array.last #

fn (a array) last() voidptr

array.last returns the last element of the array

string.last_index #

fn (s string) last_index(p string) ?int

string.last_index_byte #

fn (s string) last_index_byte(c byte) int

ustring.left #

fn (u ustring) left(pos int) string

string.limit #

fn (s string) limit(max int) string

limit returns a portion of the string, starting at 0 and extending for a given number of characters afterward. 'hello'.limit(2) => 'he' 'hi'.limit(10) => 'hi'

string.trim_suffix #

fn (s string) trim_suffix(str string) string

string.map #

fn (s string) map(func anon_fn_9_9) string

map.clone #

fn (m map) clone() map

map.delete #

fn (mut m map) delete(key string)

Removes the mapping of a particular key from the map.

map.free #

fn (m &map) free()

map.keys #

fn (m &map) keys() []string

Returns all keys in the map. TODO: add optimization in case of no deletes

string.u16 #

fn (s string) u16() u16

u16.hex #

fn (nn u16) hex() string

u16.str #

fn (n u16) str() string

array.pointers #

fn (a array) pointers() []voidptr

a.pointers() returns a new array, where each element is the address of the corresponding element in a.

array.pop #

fn (mut a array) pop() voidptr

array.pop returns the last element of the array, and removes it

array.prepend #

fn (mut a array) prepend(val voidptr)

array.prepend

array.prepend_many #

fn (mut a array) prepend_many(val voidptr, size int)

array.prepend_many

SortedMap.print #

fn (m SortedMap) print()

string.u32 #

fn (s string) u32() u32

u32.hex #

fn (nn u32) hex() string

u32.str #

fn (nn u32) str() string

string.u64 #

fn (s string) u64() u64

u64.hex #

fn (nn u64) hex() string

u64.str #

fn (nn u64) str() string

string.ustring #

fn (s string) ustring() ustring

ustring.add #

fn (u ustring) add(a ustring) ustring

ustring.at #

fn (u ustring) at(idx int) string

ustring.count #

fn (u ustring) count(substr ustring) int

counts occurrences of substr in s

ustring.index_after #

fn (u ustring) index_after(p ustring, start int) int

ustring.left #

fn (u ustring) left(pos int) string

ustring.right #

fn (u ustring) right(pos int) string

ustring.str #

fn (s ustring) str() string

ustring.substr #

fn (u ustring) substr(_start, _end int) string

array.push_many #

fn (mut a3 array) push_many(val voidptr, size int)

val is array.data TODO make private, right now it's used by strings.Builder

[]int.reduce #

fn (a []int) reduce(iter anon_fn_7_7_7, accum_start int) int

[]int.reduce executes a given reducer function on each element of the array, resulting in a single output value.

string.repeat #

fn (s string) repeat(count int) string

repeat returns a new string with a specified number of copies of the string it was called on.

array.repeat #

fn (a array) repeat(count int) array

repeat returns new array with the given array elements repeated given times.

string.replace #

fn (s string) replace(rep, with string) string

string.replace_each #

fn (s string) replace_each(vals []string) string

TODO

string.replace_once #

fn (s string) replace_once(rep, with string) string

array.reverse #

fn (a array) reverse() array

array.reverse returns a new array with the elements of the original array in reverse order.

string.reverse #

fn (s string) reverse() string

reverse will return a new reversed string.

array.reverse_in_place #

fn (mut a array) reverse_in_place()

ustring.right #

fn (u ustring) right(pos int) string

[]int.sort #

fn (mut a []int) sort()

[]int.sort sorts array of int in place in ascending order.

[]string.sort #

fn (mut s []string) sort()

[]string.sort_by_len #

fn (mut s []string) sort_by_len()

[]string.sort_ignore_case #

fn (mut s []string) sort_ignore_case()

array.sort_with_compare #

fn (mut a array) sort_with_compare(compare voidptr)

array.sort sorts array in-place using given compare function as comparator

string.split #

fn (s string) split(delim string) []string

string.split_into_lines #

fn (s string) split_into_lines() []string

string.split_nth #

fn (s string) split_nth(delim string, nth int) []string

string.starts_with #

fn (s string) starts_with(p string) bool

Option.str #

fn (o Option) str() string

OptionBase.str #

fn (o OptionBase) str() string

byte.str #

fn (c byte) str() string

----- utilities functions -----

byteptr.str #

fn (nn byteptr) str() string

voidptr.str #

fn (nn voidptr) str() string

[]string.str #

fn (a []string) str() string

[]string.str returns a string representation of the array of strings => '["a", "b", "c"]'

bool.str #

fn (b bool) str() string

u64.str #

fn (nn u64) str() string

string.str #

fn (s string) str() string

ustring.str #

fn (s ustring) str() string

i64.str #

fn (nn i64) str() string

any_int.str #

fn (n any_int) str() string

u32.str #

fn (nn u32) str() string

int.str #

fn (n int) str() string

u16.str #

fn (n u16) str() string

i16.str #

fn (n i16) str() string

i8.str #

fn (n i8) str() string

f32.str #

fn (x f32) str() string

----- f32 to string functions ----- str return a f32 as string in suitable notation

any_float.str #

fn (d any_float) str() string

f64.str #

fn (x f64) str() string

----- f64 to string functions ----- str return a f64 as string in suitable notation

int.str_l #

fn (nn int) str_l(max int) string

This implementation is the quickest with gcc -O2

string.ustring_tmp #

fn (s string) ustring_tmp() ustring

string.strip_margin #

fn (s string) strip_margin() string

Allows multi-line strings to be formatted in a way that removes white-space before a delimeter. by default | is used. Note: the delimiter has to be a byte at this time. That means surrounding the value in ``. Example: st := 'Hello there, this is a string, Everything before the first | is removed'.strip_margin() Returns: Hello there, this is a string, Everything before the first | is removed

string.strip_margin_custom #

fn (s string) strip_margin_custom(del byte) string

f64.strlong #

fn (x f64) strlong() string

return a decimal notation of the input f64

f32.strlong #

fn (x f32) strlong() string

return a decimal notation of the input f32

u32.hex #

fn (nn u32) hex() string

u32.str #

fn (nn u32) str() string

any_int.hex #

fn (nn any_int) hex() string

any_int.str #

fn (n any_int) str() string

u64.hex #

fn (nn u64) hex() string

u64.str #

fn (nn u64) str() string

voidptr.str #

fn (nn voidptr) str() string

array #

struct array {
pub:
	element_size int
pub mut:
	data         voidptr
	len          int
	cap          int
}

array.clear #

fn (mut a array) clear()

clears the array without deallocating the allocated data

array.clone #

fn (a &array) clone() array

array.clone returns an independent copy of a given array

array.delete #

fn (mut a array) delete(i int)

array.delete deletes array element at the given index

array.first #

fn (a array) first() voidptr

array.first returns the first element of the array

array.free #

fn (a &array) free()

pub fn (a []int) free() {

array.insert #

fn (mut a array) insert(i int, val voidptr)

array.insert

array.insert_many #

fn (mut a array) insert_many(i int, val voidptr, size int)

array.insert_many

array.last #

fn (a array) last() voidptr

array.last returns the last element of the array

array.pointers #

fn (a array) pointers() []voidptr

a.pointers() returns a new array, where each element is the address of the corresponding element in a.

array.pop #

fn (mut a array) pop() voidptr

array.pop returns the last element of the array, and removes it

array.prepend #

fn (mut a array) prepend(val voidptr)

array.prepend

array.prepend_many #

fn (mut a array) prepend_many(val voidptr, size int)

array.prepend_many

array.push_many #

fn (mut a3 array) push_many(val voidptr, size int)

val is array.data TODO make private, right now it's used by strings.Builder

array.repeat #

fn (a array) repeat(count int) array

repeat returns new array with the given array elements repeated given times.

array.reverse #

fn (a array) reverse() array

array.reverse returns a new array with the elements of the original array in reverse order.

array.reverse_in_place #

fn (mut a array) reverse_in_place()

array.sort_with_compare #

fn (mut a array) sort_with_compare(compare voidptr)

array.sort sorts array in-place using given compare function as comparator

array.trim #

fn (mut a array) trim(index int)

trims the array length to "index" without modifying the allocated data. If "index" is greater than len nothing will be changed

int.hex #

fn (nn int) hex() string

int.hex2 #

fn (n int) hex2() string

int.str #

fn (n int) str() string

int.str_l #

fn (nn int) str_l(max int) string

This implementation is the quickest with gcc -O2

byte.hex #

fn (nn byte) hex() string

byte.is_bin_digit #

fn (c byte) is_bin_digit() bool

byte.is_capital #

fn (c byte) is_capital() bool

byte.is_digit #

fn (c byte) is_digit() bool

byte.is_hex_digit #

fn (c byte) is_hex_digit() bool

byte.is_letter #

fn (c byte) is_letter() bool

byte.is_oct_digit #

fn (c byte) is_oct_digit() bool

byte.is_space #

fn (c byte) is_space() bool

byte.str #

fn (c byte) str() string

----- utilities functions -----

bool.str #

fn (b bool) str() string

VAssertMetaInfo #

struct VAssertMetaInfo {
pub:
	fpath   string
	line_nr int
	fn_name string
	src     string
	op      string
	llabel  string
	rlabel  string
	lvalue  string
	rvalue  string
}

VAssertMetaInfo is used during assertions. An instance of it is filled in by compile time generated code, when an assertion fails.

[]char.index #

fn (a []char) index(v char) int

[]char.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array. TODO is char type yet in the language?

f32.eq_epsilon #

fn (a f32) eq_epsilon(b f32) bool

f32.str #

fn (x f32) str() string

----- f32 to string functions ----- str return a f32 as string in suitable notation

f32.strlong #

fn (x f32) strlong() string

return a decimal notation of the input f32

f32.strsci #

fn (x f32) strsci(digit_num int) string

return a string of the input f32 in scientific notation with digit_num deciamals displayed, max 8 digits

[]int.index #

fn (a []int) index(v int) int

[]int.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

[]int.reduce #

fn (a []int) reduce(iter anon_fn_7_7_7, accum_start int) int

[]int.reduce executes a given reducer function on each element of the array, resulting in a single output value.

[]int.sort #

fn (mut a []int) sort()

[]int.sort sorts array of int in place in ascending order.

SortedMap #

struct SortedMap {
	value_bytes int
mut:
	root        &mapnode
pub mut:
	len         int
}

SortedMap.delete #

fn (mut m SortedMap) delete(key string)

SortedMap.free #

fn (mut m SortedMap) free()

SortedMap.keys #

fn (m &SortedMap) keys() []string

SortedMap.print #

fn (m SortedMap) print()

[]byte.bytestr #

fn (b []byte) bytestr() string

TODO remove this once runes are implemented

[]byte.clone #

fn (b []byte) clone() []byte

[]byte.contains #

fn (a []byte) contains(val byte) bool

TODO generic

[]byte.hex #

fn (b []byte) hex() string

[]byte.hex returns a string with the hexadecimal representation of the byte elements of the array

[]byte.index #

fn (a []byte) index(v byte) int

[]byte.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

i16.hex #

fn (nn i16) hex() string

i16.str #

fn (n i16) str() string

f64.eq_epsilon #

fn (a f64) eq_epsilon(b f64) bool

f64.str #

fn (x f64) str() string

----- f64 to string functions ----- str return a f64 as string in suitable notation

f64.strlong #

fn (x f64) strlong() string

return a decimal notation of the input f64

f64.strsci #

fn (x f64) strsci(digit_num int) string

return a string of the input f64 in scientific notation with digit_num deciamals displayed, max 17 digits

map #

struct map {
	value_bytes     int
mut:
	cap             u32
	cached_hashbits byte
	shift           byte
	key_values      DenseArray
	metas           &u32
	extra_metas     u32
pub mut:
	len             int
}

map.clone #

fn (m map) clone() map

map.delete #

fn (mut m map) delete(key string)

Removes the mapping of a particular key from the map.

map.free #

fn (m &map) free()

map.keys #

fn (m &map) keys() []string

Returns all keys in the map. TODO: add optimization in case of no deletes

i64.hex #

fn (nn i64) hex() string

i64.str #

fn (nn i64) str() string

FieldData #

struct FieldData {
pub:
	name   string
	attrs  []string
	typ    string
	is_pub bool
	is_mut bool
	type   int
}

[]string.eq #

fn (a1 []string) eq(a2 []string) bool

array_eq checks if two arrays contain all the same elements in the same order. []int == []int (also for: i64, f32, f64, byte, string)

[]string.index #

fn (a []string) index(v string) int

[]string.index returns the index of the first element equal to the given value, or -1 if the value is not found in the array.

[]string.join #

fn (a []string) join(del string) string

fn (s []string) substr(a, b int) string { return join_strings(s.slice_fast(a, b)) }

[]string.join_lines #

fn (s []string) join_lines() string

[]string.sort #

fn (mut s []string) sort()

[]string.sort_by_len #

fn (mut s []string) sort_by_len()

[]string.sort_ignore_case #

fn (mut s []string) sort_ignore_case()

[]string.str #

fn (a []string) str() string

[]string.str returns a string representation of the array of strings => '["a", "b", "c"]'

i8.hex #

fn (nn i8) hex() string

i8.str #

fn (n i8) str() string

MethodAttr #

struct MethodAttr {
pub:
	value  string
	method string
}

Option.str #

fn (o Option) str() string

OptionBase.str #

fn (o OptionBase) str() string

u16.hex #

fn (nn u16) hex() string

u16.str #

fn (n u16) str() string

string #

struct string {
pub:
	str    byteptr
	len    int
mut:
	is_lit int
}

string.after #

fn (s string) after(dot string) string

string.after_char #

fn (s string) after_char(dot byte) string

string.all_after #

fn (s string) all_after(dot string) string

string.all_after_last #

fn (s string) all_after_last(dot string) string

string.all_before #

fn (s string) all_before(dot string) string

all_before('23:34:45.234', '.') == '23:34:45'

string.all_before_last #

fn (s string) all_before_last(dot string) string

string.bool #

fn (s string) bool() bool

string.bytes #

fn (s string) bytes() []byte

string.capitalize #

fn (s string) capitalize() string

string.clone #

fn (a string) clone() string

string.contains #

fn (s string) contains(substr string) bool

string.contains_any #

fn (s string) contains_any(chars string) bool

string.contains_any_substr #

fn (s string) contains_any_substr(substrs []string) bool

string.count #

fn (s string) count(substr string) int

counts occurrences of substr in s

string.ends_with #

fn (s string) ends_with(p string) bool

string.f32 #

fn (s string) f32() f32

string.f64 #

fn (s string) f64() f64

string.fields #

fn (s string) fields() []string

string.filter #

fn (s string) filter(func anon_fn_9_16) string

string.find_between #

fn (s string) find_between(start, end string) string

'hey [man] how you doin' find_between('[', ']') == 'man'

string.free #

fn (s &string) free()

string.hash #

fn (s string) hash() int

string.i16 #

fn (s string) i16() i16

string.i64 #

fn (s string) i64() i64

string.i8 #

fn (s string) i8() i8

string.index #

fn (s string) index(p string) ?int

string.index_after #

fn (s string) index_after(p string, start int) int

string.index_any #

fn (s string) index_any(chars string) int

string.index_byte #

fn (s string) index_byte(c byte) int

string.index_old #

fn (s string) index_old(p string) int

string.int #

fn (s string) int() int

string.is_capital #

fn (s string) is_capital() bool

string.is_lower #

fn (s string) is_lower() bool

string.is_title #

fn (s string) is_title() bool

string.is_upper #

fn (s string) is_upper() bool

string.last_index #

fn (s string) last_index(p string) ?int

string.last_index_byte #

fn (s string) last_index_byte(c byte) int

string.limit #

fn (s string) limit(max int) string

limit returns a portion of the string, starting at 0 and extending for a given number of characters afterward. 'hello'.limit(2) => 'he' 'hi'.limit(10) => 'hi'

string.map #

fn (s string) map(func anon_fn_9_9) string

string.repeat #

fn (s string) repeat(count int) string

repeat returns a new string with a specified number of copies of the string it was called on.

string.replace #

fn (s string) replace(rep, with string) string

string.replace_each #

fn (s string) replace_each(vals []string) string

TODO

string.replace_once #

fn (s string) replace_once(rep, with string) string

string.reverse #

fn (s string) reverse() string

reverse will return a new reversed string.

string.split #

fn (s string) split(delim string) []string

string.split_into_lines #

fn (s string) split_into_lines() []string

string.split_nth #

fn (s string) split_nth(delim string, nth int) []string

string.starts_with #

fn (s string) starts_with(p string) bool

string.str #

fn (s string) str() string

string.strip_margin #

fn (s string) strip_margin() string

Allows multi-line strings to be formatted in a way that removes white-space before a delimeter. by default | is used. Note: the delimiter has to be a byte at this time. That means surrounding the value in ``. Example: st := 'Hello there, this is a string, Everything before the first | is removed'.strip_margin() Returns: Hello there, this is a string, Everything before the first | is removed

string.strip_margin_custom #

fn (s string) strip_margin_custom(del byte) string

string.substr #

fn (s string) substr(start, end int) string

string.title #

fn (s string) title() string

string.to_lower #

fn (s string) to_lower() string

TODO only works with ASCII

string.to_upper #

fn (s string) to_upper() string

string.to_wide #

fn (_str string) to_wide() &u16

string.trim #

fn (s string) trim(cutset string) string

string.trim_left #

fn (s string) trim_left(cutset string) string

string.trim_prefix #

fn (s string) trim_prefix(str string) string

string.trim_right #

fn (s string) trim_right(cutset string) string

string.trim_space #

fn (s string) trim_space() string

string.trim_suffix #

fn (s string) trim_suffix(str string) string

string.u16 #

fn (s string) u16() u16

string.u32 #

fn (s string) u32() u32

string.u64 #

fn (s string) u64() u64

string.ustring #

fn (s string) ustring() ustring

string.ustring_tmp #

fn (s string) ustring_tmp() ustring

string.utf32_code #

fn (_rune string) utf32_code() int

Convert utf8 to utf32

ustring #

struct ustring {
pub mut:
	s     string
	runes []int
	len   int
}

mut: hash_cache int NB string.is_lit is an enumeration of the following: .is_lit == 0 => a fresh string, should be freed by autofree .is_lit == 1 => a literal string from .rodata, should NOT be freed .is_lit == -98761234 => already freed string, protects against double frees. ^^^^^^^^^ calling free on these is a bug. Any other value means that the string has been corrupted.

ustring.add #

fn (u ustring) add(a ustring) ustring

ustring.at #

fn (u ustring) at(idx int) string

ustring.count #

fn (u ustring) count(substr ustring) int

counts occurrences of substr in s

ustring.index_after #

fn (u ustring) index_after(p ustring, start int) int

ustring.left #

fn (u ustring) left(pos int) string

ustring.right #

fn (u ustring) right(pos int) string

ustring.str #

fn (s ustring) str() string

ustring.substr #

fn (u ustring) substr(_start, _end int) string

[]u64.contains #

fn (a []u64) contains(val u64) bool

TODO generic

FunctionData #

struct FunctionData {
pub:
	name     string
	attrs    []string
	ret_type string
	type     int
}

byteptr.str #

fn (nn byteptr) str() string

byteptr.vstring #

fn (bp byteptr) vstring() string

byteptr.vstring() - converts a C style string to a V string. NB: the string data is reused, NOT copied.

byteptr.vstring_with_len #

fn (bp byteptr) vstring_with_len(len int) string

byteptr.vstring_with_len() - converts a C style string to a V string. NB: the string data is reused, NOT copied.

any_float.str #

fn (d any_float) str() string

DenseArray.clone #

fn (d DenseArray) clone() DenseArray