strKeep Function

Deletes all of the characters in a text string that are not included in another text string. That is, the second string specifies which characters to keep in the first string.


str strKeep(str _text1, str _text2)

Parameter

Description

_text1

The first text string.

_text2

The characters to keep in the first text string.

The text string equivalent to _text1 with all the characters removed except those that appear in _text2.

The strKeep function is complementary to the strRem function.

// Returns the text string BBCDDB.
strKeep("ABBCDDEFGHB","BCD");

Community Additions

ADD
Show: