stripchar(
stripchar(
TEXT
,
RANGE
)

The stripchar( function extracts characters you don’t want from a text item.

Parameters

This function has two parameters:

text – is the item of text from which you want to extract characters.

range – specifies what kinds of characters you want to keep and (implicitly) what kinds of characters you want to strip away. The range consists of one or more pairs of characters. Each pair specifies a set of characters you want to keep. For example, the pair `AZ` means that you want to keep the characters from `A` to `Z`. For alphanumeric characters the set is pretty obvious. For other types of characters you should check a Unicode character chart. For example the pair `#&` specifies a set of four characters: `#`, `$`, `%` and `&`.

If a pair consists of the same character repeated twice in a row, the set is just that single character. For instance the pair `##` means you want to keep one character: `#`.

The range may consist of several pairs put together. For example the range `AZaz09..` consists of four pairs, and specifies that all letters, numbers, and periods will be kept, with all other characters stripped away.

Description

The stripchar( function removes characters you don’t want from a text item. You specify exactly what kinds of characters you want and don’t want included in the final output.

    stripchar("abcdefghijklmnopqrstuvwxyz","af") ☞ abcdef
    stripchar("abcdefghijklmnopqrstuvwxyz","mq") ☞ mnopq
    stripchar("abcdefghijklmnopqrstuvwxyz","afxz") ☞ abcdefxyz
    stripchar("abcdefghijklmnopqrstuvwxyz","aaeeiioouu") ☞ aeiou
    stripchar("Now is the time","aaeeiioouu") ☞ oieie
    stripchar("Your Mileage May Vary","AZ") ☞ YMMV

See Also

- percentescape( -- encodes specified characters using percent encoding.
- percentunescape( -- decodes text that contains percent encoding.
- strip( -- strips off leading and trailing blanks and other whitespace (carriage returns, tabs, etc.)
- stripdiacriticals( -- strips diacritical marks from text.
- stripprintable( -- strips non-printable characters from text.
- striptoalpha( -- removes everything but alphabetic letters from a text item.
- striptonum( -- removes everything but numeric digits from a text item.
- urldecode( -- decodes text that contains percent encoded characters.
- urlencode( -- converts text into a legal URL (by converting spaces into `%20`). WARNING: THIS FUNCTION IS OBSOLETE.

History

Version | Status | Notes
10.0 | Updated | Carried over from Panorama 6.0, but now handles Unicode character ranges instead of ASCII.