Skip to content

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)
    // Test StrLast function
    bool test_str_last(void) {
        WriteFmt("Testing StrLast\n");
        DefaultAllocator alloc = DefaultAllocatorInit();
    
        // Get the last character
        char last = StrLast(&s);
    
        // Check that the character is correct
Last updated on