PreviousUpNext

5.5.29  Drop the first N characters of a string

Drop the first character of a string:

    eval:  string::extract ("fubar", 1, NULL);
    "ubar"

Another way:

    eval:  regex::find_first_match_to_ith_group 1 ./^.(.*)$/ "fubar";
    THE "ubar"

Drop the first two characters of a string:

    eval:  string::extract ("fubar", 2, NULL);
    "bar"

Another way:

eval:  regex::find_first_match_to_ith_group 1 ./^..(.*)$/ "fubar";
THE "bar"

Comments and suggestions to: bugs@mythryl.org

PreviousUpNext