15. Boost package for string manipulation library¶
The STRINGS boost module implements collection of helper macros and functions to accompany STRINGS.
All functions and symbols are in “strings_boost” module, use require to get access to it.
require daslib/strings_boost
15.1. Split and join¶
-
split
(text: string const; delim: string const)¶
split returns array<string>
argument |
argument type |
---|---|
text |
string const |
delim |
string const |
Split string given delimiter.
-
split_by_chars
(text: string const; delim: string const)¶
split_by_chars returns array<string>
argument |
argument type |
---|---|
text |
string const |
delim |
string const |
Split string given set of delimiters (string treated as characters).
-
join
(it: auto const; separator: string const)¶
join returns auto
argument |
argument type |
---|---|
it |
auto const |
separator |
string const |
Join mulitiple strings with delimiter.
-
split
(text: string const; delim: string const; blk: block<(arg:array<string> const#):auto> const)
split returns auto
argument |
argument type |
---|---|
text |
string const |
delim |
string const |
blk |
block<(arg:array<string> const#):auto> const |
Split string given delimiter.
-
split_by_chars
(text: string const; delim: string const; blk: block<(arg:array<string> const#):auto> const)
split_by_chars returns auto
argument |
argument type |
---|---|
text |
string const |
delim |
string const |
blk |
block<(arg:array<string> const#):auto> const |
Split string given set of delimiters (string treated as characters).
15.2. Formatting¶
-
wide
(text: string const; width: int const)¶
wide returns string
argument |
argument type |
---|---|
text |
string const |
width |
int const |
Pad string with ` ` character to make it certain width.
15.3. Queries and comparisons¶
-
is_character_at
(foo: array<uint8> const#; idx: int const; ch: int const)¶
is_character_at returns auto
argument |
argument type |
---|---|
foo |
array<uint8> const# |
idx |
int const |
ch |
int const |
Returns true if specific character is at specific string position.
-
eq
(a: string const; b: das_string const)¶
eq returns auto
argument |
argument type |
---|---|
a |
string const |
b |
builtin::das_string const |
Compares das_string and string. True if equal.
-
eq
(b: das_string const; a: string const)
eq returns auto
argument |
argument type |
---|---|
b |
builtin::das_string const |
a |
string const |
Compares das_string and string. True if equal.