| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Removes all words (2-byte sequence) but the specified ones from a string
WordOnly( <cWordList>, <cString> ) --> cResult
The function searches for 2-byte sequences (words) in <cString> and removes all of the words in the result string that do not exist in <cWordList>.
| See also: | CharOnly() |
| Category: | CT:String manipulation , Character functions |
| Source: | ct\charonly.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example displays results of WordOnly()
PROCEDURE Main
LOCAL cString := "abab12cd1212cdefef"
? WordOnly( "12" , cString ) // result: 121212
? WordOnly( "abef", cString ) // result: ababefef
RETURN
http://www.xHarbour.com