str
String utilities.
Functions
1. str::ascii
Explodes string into list of ascii char codes.
Type definition
func(text: string -> list(int))
List of arguments
Name | Type | Description |
---|---|---|
text | string | Incoming string |
List of results
Name | Type | Description |
---|---|---|
- | list(int) | Returned list of ints |
2. str::fmt
Converts float value into string using given string template.
Type definition
func(format: string, values: list(any) -> string)
List of arguments
Name | Type | Description |
---|---|---|
format | string | Format template |
values | list(any) | List of values |
List of results
Name | Type | Description |
---|---|---|
- | string | Formatted value |
3. str::hex
Converts int into hexadecimal string representation.
Type definition
func(value: int, width: int -> string)
List of arguments
Name | Type | Description |
---|---|---|
value | int | Initial value |
width | int | Hex digit width |
List of results
Name | Type | Description |
---|---|---|
- | string | Hexadecimal representation |
4. str::len
Retruns length of a string.
Type definition
func(text: string -> int)
List of arguments
Name | Type | Description |
---|---|---|
text | string | String value |
List of results
Name | Type | Description |
---|---|---|
- | int | String length |
5. str::lower
Converts string to lower case.
Type definition
func(text: string -> string)
List of arguments
Name | Type | Description |
---|---|---|
text | string | Initial text |
List of results
Name | Type | Description |
---|---|---|
- | string | Text in lower case |
6. str::parse
Parses float from string, throws exception if no float value is found.
Type definition
func(text: string -> float)
List of arguments
Name | Type | Description |
---|---|---|
text | string | String representstion of float value |
List of results
Name | Type | Description |
---|---|---|
- | float | Parsed value |
7. str::pos
Finds position oof subtext in given text, returns -1 if no subtext found.
Type definition
func(subtext: string, text: string -> int)
List of arguments
Name | Type | Description |
---|---|---|
subtext | string | Subtext to find in text |
text | string | Initial text |
List of results
Name | Type | Description |
---|---|---|
- | int | Position of subtext |
8. str::sub
Returns a substring from a string by given position and length.
Type definition
func(text: string, pos: int, len: int -> string)
List of arguments
Name | Type | Description |
---|---|---|
text | string | Initial text |
pos | int | Position of a substring |
len | int | Length of a substring |
List of results
Name | Type | Description |
---|---|---|
- | string | Substring |
9. str::text
Builds a string from a list of int ascii codes. Opposite function to str::ascii.
Type definition
func(bytes: list(int) -> string)
List of arguments
Name | Type | Description |
---|---|---|
bytes | list(int) | List of ascii codes |
List of results
Name | Type | Description |
---|---|---|
- | string | String |
10. str::upper
Converts string to upper case.
Type definition
func(text: string -> string)
List of arguments
Name | Type | Description |
---|---|---|
text | string | Initial text |
List of results
Name | Type | Description |
---|---|---|
- | string | Text in upper case |