CheckStrLimit Function

Syntax

String CheckStrLimit(String stringA, String stringB, String comparisonType, Number maxChars = -1)

Return Value

String

"Passed" if the comparison indicates that the strings match or if the Comparison Type is "LOG". "Failed" if otherwise.

Purpose

This function compares two strings or a string against a regular expression pattern using the comparison type you specify.

Parameters

stringA as String

The first string to compare.

stringB as String

The second string or pattern to compare.

Note The regular expression pattern follows the standard ECMAScript grammar. Refer to the Microsoft documentation for regular expressions for more information.

comparisonType as String

A string that specifies how to compare the strings. The valid values are "LOG", "IgnoreCase", "CaseSensitive", "RegularExpressionIgnoreCase", and "RegularExpressionCaseSensitive".

maxChars as Number

(Optional) A number that specifies the maximum number of characters to compare. Pass -1 to compare all characters. The default is -1. For Regular Expression cases, it matches the first maxChars characters of the string to the given pattern.