See also: stripCharacters

Removes all occurrences of a second character string from the first character string.

Syntax

JSV_stripString(expS1, expS2)

Prototype

expS1.stripString(expS2)

Returns

The stripString function returns the string expS1 with all occurrences of the character string expS2 removed from it. If the character string expS2 does not exist in expS1, then the character string expS1 is returned. If either or both arguments are empty, then null is returned.

Parameters

The stripString function uses the following arguments.

Argument Description
expS1 String being stripped.
expS2 String that is stripped from expS1.

Remarks

Unlike stripCharacters, stripString removes the designated string from the target string.

Dependencies

JSV_isEmpty

Example

The following lines of code

var testString1 = "Quiet feet make little noise on sleek ice", testString2 = "ee";
document.write( "Removing " + testString2.bold() + 
    " from " +
    testString1.bold() +
    " results in " +
    JSV_stripString(testString1,testString2).bold() );
testString2 = "le";
document.write( "Removing " + testString2.bold() + 
    " from " +
    testString1.bold() +
    " results in " +
    JSV_stripString(testString1,testString2).bold() );

produce