String

#import Builtin:String;

A builtin module defining the string type See Also: string

Functions


string()

create :: string() 

Creates an empty string

Returns:

A new empty string instance

string(*char)

create :: string(c : exact *char) 

Creates a string from a null-terminated character array

Arguments

c
exact *char
Pointer to a null-terminated character array

Returns:

A new string containing the characters from the array

printl(string)

printl :: (s : exact string) 

A function to overload printl(*char) for strings

Structs


string

The string data type You can declare a string using double quotes:

s : string = "Hello, World!";

Methods:

string.size()

size :: uint32() 

Returns:

The length in characters of the string

string.dump()

dump :: () 

Prints all of the info related to the string instance to the terminal

Operators


+(string, string)

operator+ :: string(thisStr : exact string, otherStr : exact string)

Concatenates two strings together

Arguments

thisStr
exact string
The first string
otherStr
exact string
The second string

Returns:

A new string containing the concatenation of both strings

+(string, char)

operator+ :: string(thisStr : exact string, ch : exact char)

Concatenates a string with a character

Arguments

thisStr
exact string
The string
ch
exact char
The character to be added

Returns:

A new string containing the concatenation of the string and character

+(*char, *char)

operator+ :: *char(thisStr : exact *char, otherStr : exact *char)

Concatenates two null-terminated character arrays

Arguments

thisStr
exact *char
The first character array
otherStr
exact *char
The second character array

Returns:

A pointer to a new character array containing the concatenation