public class Strings
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static boolean |
containsNonNumberCharacters(java.lang.String s) |
static java.util.Collection<java.lang.String> |
escape(java.util.Collection<java.lang.String> ss)
Invokes
escape(String) on each string in the given collection. |
static java.lang.String |
escape(java.lang.String s)
Escapes special characters in the given string.
|
static java.lang.String |
escape(java.lang.String s,
boolean onlyEscapeEscapeSequences)
Escapes special characters in the given string.
|
static java.lang.String |
escapeSource(java.lang.String s)
Escapes quotes and special characters in the (Javascript source) string.
|
static java.lang.String |
getSharedPrefix(java.lang.String a,
java.lang.String b)
Returns the longest common prefix of the two given strings.
|
static boolean |
isArrayIndex(java.lang.String s)
Checks whether the given string is a valid array index.
|
static boolean |
isIdentifier(java.lang.String s)
Checks whether the given string is a valid identifier (where reserved words are not valid).
|
static boolean |
isIdentifierAndNotPrefixOfReservedName(java.lang.String s)
Checks whether the given string is an identifier and not a prefix of a reserved name.
|
static boolean |
isIdentifierParts(java.lang.String s)
Checks whether the given string consists of valid identifier parts.
|
static boolean |
isNumeric(java.lang.String s)
Checks whether the given string is a valid double, including Infinity, -Infinity, and NaN.
|
static boolean |
isOtherIdentifierParts(java.lang.String s)
Checks whether the given string consists of valid identifier parts excluding identifiers.
|
static java.lang.String |
randomString(int len)
Generates a random string of the given length containing digits and letters.
|
static void |
reset()
Resets the random string generator.
|
public static boolean containsNonNumberCharacters(java.lang.String s)
public static java.util.Collection<java.lang.String> escape(java.util.Collection<java.lang.String> ss)
escape(String)
on each string in the given collection.public static java.lang.String escape(java.lang.String s)
public static java.lang.String escape(java.lang.String s, boolean onlyEscapeEscapeSequences)
public static java.lang.String escapeSource(java.lang.String s)
public static java.lang.String getSharedPrefix(java.lang.String a, java.lang.String b)
public static boolean isArrayIndex(java.lang.String s)
public static boolean isIdentifier(java.lang.String s)
public static boolean isIdentifierAndNotPrefixOfReservedName(java.lang.String s)
public static boolean isIdentifierParts(java.lang.String s)
public static boolean isNumeric(java.lang.String s)
public static boolean isOtherIdentifierParts(java.lang.String s)
public static java.lang.String randomString(int len)
public static void reset()
Copyright © 2009-2019 Aarhus University