Product SiteDocumentation Site

7.4.26. DELWORD (Delete Word)


>>-DELWORD(string,n--+---------+--)----------------------------><
                     +-,length-+

Returns string after deleting the substring that starts at the nth word and is of length whitespace-delimited words. If you omit length, or if length is greater than the number of words from n to the end of string, the function deletes the remaining words in string (including the nth word). The length must be a positive whole number or zero. n must be a positive whole number. If n is greater than the number of words in string, the function returns string unchanged. The string deleted includes any whitespace characters following the final word involved but none of the whitespace preceding the first word involved.
Here are some examples:

Example 7.38. Builtin function DELWORD

DELWORD("Now is the  time",2,2)  ->  "Now time"
DELWORD("Now is the time ",3)    ->  "Now is "
DELWORD("Now is the  time",5)    ->  "Now is the  time"
DELWORD("Now is   the time",3,1) ->  "Now is   time"
DELWORD("Now is the  time",2,2)  ->  "Now time"