![]() |
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.
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
Date created: 10/5/2010 |