Description
Add common string utility functions:
| Function |
Description |
trim(src, dst) |
Remove leading and trailing whitespace |
to_upper(src, dst) |
Convert all characters to uppercase |
to_lower(src, dst) |
Convert all characters to lowercase |
starts_with(src, prefix) |
Check if string starts with prefix |
ends_with(src, suffix) |
Check if string ends with suffix |
References
- Standard: ASCII character table (uppercase A-Z: 0x41–0x5A, lowercase a-z: 0x61–0x7A)
- Standard C equivalents:
toupper, tolower from <ctype.h> (locale-dependent)
- Wikipedia: ASCII
- Wikipedia: Trim (string)
Description
Add common string utility functions:
trim(src, dst)to_upper(src, dst)to_lower(src, dst)starts_with(src, prefix)ends_with(src, suffix)References
toupper,tolowerfrom<ctype.h>(locale-dependent)