StrLast
Description
Access the last character of the string by value. Caller must ensure the string is non-empty.
Parameters
| Name | Direction | Description |
|---|---|---|
str |
in | String to query. |
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Access.c:65:
// Test StrLast function
bool test_str_last(void) {
WriteFmt("Testing StrLast\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Access.c:72:
// Get the last character
char last = StrLast(&s);
// Check that the character is correct
Last updated on