StrPopFront
Description
Remove the first character from the string and optionally store it. Trailing characters shift one slot to the left. Pass NULL for chr to discard. See VecPopFront for the full SUCCESS/FAILURE contract.
Usage example (Cross-references)
Usage examples (Cross-references)
- In
Str.Remove.c:49:
// Test StrPopFront function
bool test_str_pop_front(void) {
WriteFmt("Testing StrPopFront\n");
DefaultAllocator alloc = DefaultAllocatorInit();- In
Str.Remove.c:57:
// Pop a character from the front
char c;
StrPopFront(&s, &c);
// Check that the character was popped correctly
- In
Str.Remove.c:64:
// Pop another character without storing it - avoid passing NULL directly
char ignored;
StrPopFront(&s, &ignored);
// Check that the character was removed
Last updated on