Skip to content
StrPushFrontCstr

StrPushFrontCstr

StrPushFrontCstr

Description

Push a array of characters with given length to the front of this string

Parameters

Name Direction Description
str in,out Str to insert array chars into.
cstr in array of characters with given length to be inserted.

Success

str

Failure

NULL

Usage example (Cross-references)

Usage examples (Cross-references)
                    StrPushFront(&output_path, '/');
                    LOG_INFO("{}", output_path);
                    StrPushFrontCstr(&output_path, project.build_dir.data, project.build_dir.length);
                    LOG_INFO("{}", output_path);
                    StrReplaceZstr(&output_path, ".c", ".md", 1);
    // Test StrPushFrontCstr function
    bool test_str_push_front_cstr(void) {
        WriteFmt("Testing StrPushFrontCstr\n");
    
        Str s = StrInitFromZstr("World");
    
        // Push a string at the front
        StrPushFrontCstr(&s, "Hello ", 6);
    
        // Check that the string was inserted correctly
    /// FAILURE : NULL
    ///
    #define StrPushFrontZstr(str, zstr) StrPushFrontCstr((str), (zstr), strlen((zstr)))
    
    ///
Last updated on