|
STRING WORDName:
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 <sout> is the name of the resulting string; <sorg> is the name of the original string; and <nword> is the index of the word to extract.
LET SOUT = STRING WORD S1 5
In this case, FNAME will now contain the extracted word rather than the original string.
you need to do
LET FNAME = STRING WORD SORG 2 The word index position can be either a parameter or a numeric value. However, it cannot be a numeric expression. So
LET FNAME = STRING WORD SORG NWORD are both allowed but
is not allowed. You would need to enter this as
LET FNAME = STRING WORD FNAME NWORD The name on the left hand side of the equal sign may be a previously existing string. However, if it is a previously existing parameter, variable, or matrix name, an error will be reported and the requested string 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
|
Privacy
Policy/Security Notice
NIST is an agency of the U.S.
Commerce Department.
Date created: 10/05/2010 |