Determines whether or not any characters in a first character string do not exist in a second character string.

Syntax

JSV_allowInString(expS1, expS2)

Prototype

expS1.allowInString(expS2)

Returns

The allowInString function returns true if all the characters in the string expS1 exist in the string expS2; otherwise, false.

Parameters

The allowInString function uses the following arguments.

Argument Description
expS1 The character expression that is searched.
expS2 The string that contains the characters that are only allowed to exist in expS1.

Remarks

n/a

Dependencies

JSV_isEmpty, JSV_stripCharacters

Example

The following lines of code

var allowedCharacters = "ABCDEF", testString = "AFCD";
document.write( testString + 
    " only contains characters in " + 
    allowedCharacters +
    "? " +
    JSV_allowInString(testString, allowedCharacters) );
testString = "AFCD1234";
document.write( testString + 
    " only contains characters in " + 
    allowedCharacters +
    "? " +
    JSV_allowInString(testString, allowedCharacters) );

produce