SiMX Help‎ > ‎The Target Platform‎ > ‎Objects‎ > ‎TARGET Object‎ > ‎target.strlib‎ > ‎

GetWords


Platform Objects


e

Description

Extracts an array of words of text from the input.  This function is a smart way to locate and parse words just like double clicking highlights a word.

Syntax


target.strlib.GetWords( input, root_words )

          input - Input string
root_words Boolean (input) - when set to true only the root of the word(s) are returned, that is all prefixes and suffixes are striped off, for example "words" or "wording" become "word" (default is false)

Return value


An array of words

Sample

'---------- Start ----------
Function Start
Dim str, arr

str = "Extract all the words in the string."
arr = target.strlib.GetWords( str, true )
trg.Message( arr(4) )

End Function

In this case GetWords extracts every word and reduces them to their root (because the root_words parameter is true) and puts them in the array arr. Then trg.Message displays the 5th element in the array. 

See also


Platform Objects and Methods
Trim
Split
Mid