Replace delimiters in string.
Syntax: @wdelim(str_list, src_delim, dest_delim)
str_list: string
src_delim string delimiter
dest_delim string delimiter
Return: string
Returns a string list, replacing every appearance of the src_delim delimiter in str_list with a dest_delim delimiter. Delimiters must be single characters.
Note that most other string list functions (those beginning with “@w”) require that the delimiter be a space (“ ”). Use this function to convert strings with other delimiters into those which can be used with the string list functions.
Examples
@wdelim("Arizona, California, Washington", ",", "-")
identifies the comma as the source delimiter and replaces each comma with a dash, returning the string “Arizona-California-Washington”.
If ALPHA1 is an alpha series,
alpha alphad = @wdelim(alpha1, ",", ":")
replaces each “,” with “:” in the string lists in ALPHA1, for each observation in the workfile sample.
If SVEC1 is a vector,
svector svecd = @wdelim(svec1, ",", ";")
replaces each delimiter “,” with “;” in the string lists in SVEC1 for each element.
Cross-references