Predicate function - Text
The text functions are used for validating string content, format, patterns, and character composition.
-
Unless explicitly stated, predicates operate on string inputs only.
-
Non-string values (null, undefined, objects, arrays, dates) return false.
-
Null, empty strings (" "), and whitespace-only strings are treated distinctly.
-
Text predicates are case-sensitive by default and support Unicode where applicable.
|
Function |
Description |
Example |
|---|---|---|
| IsText(value) | Returns true if the value is a text/string. |
|
| IsEmpty(value) | Returns true if the value is an empty string (zero length). |
|
| IsNotEmpty(value) | Returns true if the text is not empty. |
|
| IsNull(value) | Returns true if the value is null |
|
| IsNotNull(value) | Returns true if the value is not null. |
|
| IsNullOrEmpty(value) | Returns true if the text is null or empty. |
|
| IsNullOrWhiteSpace(value) | Returns true if the text is null, empty, or contains only whitespace. |
|
| IsAlpha(value) | Returns true if the text contains only alphabetic characters. |
|
| IsAlphanumeric(value) | Returns true if the text contains only letters and numbers. |
|
| IsNumericString(value) | Returns true if the text contains only numeric characters. |
|
| IsUpperCase(value) | Returns true if all letters in the text are uppercase. |
|
| IsLowerCase(value) | Returns true if all letters in the text are lowercase. |
|
| IsMixedCase(value) | Returns true if the text contains both uppercase and lowercase letters. |
|
| IsTrimmed(value) | Returns true if the text has no leading or trailing whitespace. |
|
| ContainsLetters(value) | Returns true if the text contains at least one letter. |
|
| ContainsDigits(value) | Returns true if the text contains at least one digit. |
|
| ContainsWhitespace(value) | Returns true if the text contains whitespace characters. |
|
| HasSpecialCharacters(value) | Returns true if the text contains at least one special character (non-alphanumeric, non-whitespace). |
|
| IsMinimumLength(value, length) | Returns true if the text length is greater than or equal to a minimum length. |
|
| IsMaximumLength(value, length) | Returns true if the text length is less than or equal to a maximum length. |
|
| IsExactLength(value, length) | Returns true if the text length exactly matches the specified length. |
|
| IsLengthBetween(value, min, max) | Returns true if the text length is between the minimum and the maximum range. |
|
| MatchesPattern(value, pattern) | Returns true if the text matches the specified regular expression pattern. |
|
| DoesNotMatchPattern(value, pattern) | Returns true if the text does not match the specified regular expression pattern. |
|
| IsPalindrome(value) | Returns true if the text is palindrome (reads the same forwards and backwards). |
|
| HasConsecutiveCharacters(value, count) | Returns true if the text has a specified number of consecutive identical characters. |
|
| Contains(substring, value) | Returns true if the text contains the specified substring. |
|
| ContainsLetter(value, letter) | Returns true if the text contains the specified letter. |
|
| ContainsSpecialCharacter(value, character) | Returns true if the text contains the specified special character. |
|
| StartsWith(value, substring) | Returns true if the text starts with the specified substring. |
|
| StartsWithLetter(value, letter) | Returns true if the text starts with the specified letter. |
|
| StartsWithNumber(value, number) | Returns true if the text starts with the specified number. |
|
| EndsWith(value, substring) | Returns true if the text ends with the specified substring. |
|
| EndsWithLetter(value, letter) | Returns true if the text ends with the specified letter. |
|
| EndsWithNumber(value, number) | Returns true if the text ends with the specified number. |
|
| IsEmail(value) | Returns true if the text is a valid email address format. |
|
| IsPhoneNumber(value) | Returns true if the text is a valid phone number format (generic, various formats). |
|
| IsUSPhoneNumber(value) | Returns true if the text is a valid US phone number format (10 digits). |
|
| IsURL(value) | Returns true if the text is a valid URL format. |
|
| IsIPAddress(value) | Returns true if the text is a valid IP address (IPv4 or IPv6). |
|
| IsIPv4(value) | Returns true if the text is a valid IPv4 address. |
|
| IsIPv6(value) | Returns true if the text is a valid IPv6 address. |
|
| IsUSZipCode(value) | Returns true if the text is a valid US ZIP code (5 digits or ZIP+4 format). |
|
| IsUKPostcode(value) | Returns true if the text is a valid UK postcode format. |
|
| IsSSN(value) | Returns true if the text is a valid Social Security Number format (XXX-XX-XXXX). |
|
| IsGUID(value) | Returns true if the text is a valid GUID/UUID format. |
|
| IsHexColor(value) | Returns true if the text is a valid hexadecimal color code (#RGB or #RRGGBB). |
|
| IsJSON(value) | Returns true if the text is a valid JSON format. |
|
| ISBase64(value) | Returns true if the text is valid Base64 encoded data. |
|