CharOnly()

CHARONLY()

Intersectional set of two strings based on characters

Syntax

      CHARONLY( <cThisCharactersOnly>, <cString> ) -> cReducedString

Arguments

<cThisCharactersOnly> specifies the characters that must not be deleted in <cString>. <cString> is the string that should be processed

Returns

<cReducedString> A string with all characters deleted but those specified in <cThisCharactersOnly>.

Description

The CHARONLY() function calculates the intersectional set of two strings. To do this, it deletes all characters from <cString> that do not appear in <cThisCharacterOnly>.

Examples

      ? CHARONLY( "0123456789", "0211 - 38 99 77" )  //  "0211389977"
      ? CHARONLY( "0123456789", "0211/ 389 977" )    //  "0211389977"

Tests

      CHARONLY( "0123456789", "0211 - 38 99 77" ) == "0211389977"
      CHARONLY( "0123456789", "0211/ 389 977" )   == "0211389977"

Compliance

CHARONLY() is compatible with CT3’s CHARONLY().

Platforms

All

Files

Source is charonly.c, library is ct3.

Seealso

CHARREM(), WORDONLY(), WORDREM()

2 responses to “CharOnly()

  1. Pingback: Harbour String Functions | Viva Clipper !

  2. Pingback: Harbour All Functions – C | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.