
function bytes = match_beginning(str, needle) 


    str_len = cols(str);
    needle_len = cols(needle);
    
    if (str_len >= needle_len) && tobool(str(1, 1:needle_len) == needle)
        bytes = needle_len;
    else
        bytes = 0;
    end


end
