|
NUMBER OF WORDSName:
Dataplot delineates words in a string by spaces. It will treat non-printing characters in the string as spaces. That is, any character in the string with an ASCII collating index less than or equal to 32 or greater than 127 will be treated as a space. In particular, tabs will be treated as spaces. However, hyphens and other special characters such as "&" will not be treated as word boundaries.
where <nword> is a parameter containing the returned number of words in the string; and <sorg> is the name of the string.
you need to do
LET NWORD = NUMBER OF WORDS SORG The name on the left hand side of the equal sign may be a previously existing parameter. However, if it is a previously existing string/function, variable, or matrix name, an error will be reported and the requested parameter will not be created.
command. Previously, only the space character (non-printing characters are interpreted as spaces) was recognized. With this command, you can specify a specific character as a delimiter. If a non-space character is specified, spaces and non-printing characters will be treated as part of the word and not as delimiters. The most common use for this is in parsing comma delimited files.
2020/08: Added support for the SET WORD DELIMITER command let string s = funnel ramp cone square . feedback off print "String s = ^s" let nword = number of words s loop for k = 1 1 nword let s^k = string word s k print "String ^k = ^s^k" end of loop feedback on
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 10/05/2010 |