PreviousUpNext

5.5.31  Extract a substring of string

Extract second and third characters of a string as a string:

    eval:  string::extract ("fubar", 1, THE 2);
    "ub"

Another way:

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

Comments and suggestions to: bugs@mythryl.org

PreviousUpNext