sub ( reg, sub, var );
This built-in function performs a substitution for the first match found. This searches var for reg, and if found, replaces reg with sub. In other words, reg is the old string or pattern you want to replace, sub is the new string you want to put in the place of reg, and var is the string where you want the replacement to happen. The parameter reg is a regular expression, sub is a string constant, and var is a string variable.
Example
sub( /[*]*/,"", hdr ); #
Remove the first run of asterisks from the text in hdr
Last modified date: 12/03/2024