See also: stripString |
Removes occurrences of all the characters in a second character string from the first character string.
JSV_stripCharacters(expS1, expS2)
expS1.stripCharacters(expS2)
The stripCharacters function returns the string expS1 with all occurrences of each character in expS2 removed. If any character in expS2 does not exist in expS1, then the character string expS1 is returned. If either or both arguments are empty, then null is returned.
The stripCharacters function uses the following arguments.
Argument | Description |
expS1 | String being stripped. |
expS2 | String containing the characters to be stripped from expS1. |
Unlike stripString, stripCharacters removes each character in the designated string from the target string.
The following lines of code
var testString1 = "Quiet feet make little noise on sleek ice", testString2 = "e";
document.write( "Removing " + testString2.bold() +
" from " +
testString1.bold() +
" results in " +
JSV_stripCharacters(testString1,testString2).bold() );
testString2 = "e";
document.write( "Removing " + testString2.bold() +
" from " +
testString1.bold() +
" results in " +
JSV_stripCharacters(testString1,testString2).bold() );
produce
Copyright © 1998-2000 Roaring Fork Software. All rights reserved.