String
The Ioto runtime provides a suite of "safe" string handling routines.
These help guard against buffer overflows and NULL dereferencing errors.
The strings are all NULL tolerant and will not crash when passed NULL arguments. For example, copying a NULL string will return an empty string and searching for a pattern in a NULL string will return false.
The string routines all use a "s" prefix.
API Tour
There are many (many) runtime string routines. Here is a short sampling:
Search for a character in a string (strchr):
1 |
|
Clone (duplicate) a string (strdup):
1 |
|
Get the length of a string (strlen):
1 |
|
Check if a string contains a pattern (strstr):
1 |
|
Format a string (sprintf):
1 |
|
Join two strings
1 |
|
Get a title case string (Leading cap):
1 |
|
Trim a string of certain characters:
1 |
|
API Reference
The full API is specified here: