xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

WordOnly()

Removes all words (2-byte sequence) but the specified ones from a string

Syntax

WordOnly( <cWordList>, <cString> ) --> cResult

Arguments

<cWordList>
This is a character string holding 2-byte sequences (words) to ignore in <cString>.
<cString>
This is the character string to process.

Return

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>.

Info

See also:CharOnly()
Category: CT:String manipulation , Character functions
Source:ct\charonly.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of WordOnly()

   PROCEDURE Main
      LOCAL cString := "abab12cd1212cdefef"

      ? WordOnly( "12"  , cString )   // result: 121212

      ? WordOnly( "abef", cString )   // result: ababefef

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe