public class Strings extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
escape(String s)
Escapes special characters in the given string.
|
static String |
escapeSource(String s)
Escapes quotes and special characters in the (Javascript source) string.
|
static boolean |
isArrayIndex(String s)
Checks whether the given string is a valid array index.
|
static boolean |
isIdentifier(String s)
Checks whether the given string is a valid identifier (where reserved words are not valid).
|
static boolean |
isIdentifierAndNotPrefixOfReservedName(String s)
Checks whether the given string is an identifier and not a prefix of a reserved name.
|
static boolean |
isIdentifierParts(String s)
Checks whether the given string consists of valid identifier parts.
|
static boolean |
isNumber(String s)
Checks whether the given string is a valid double, including Infinity, -Infinity, and NaN.
|
static 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 String escape(String s)
public static String escapeSource(String s)
public static boolean isArrayIndex(String s)
public static boolean isIdentifier(String s)
public static boolean isIdentifierAndNotPrefixOfReservedName(String s)
public static boolean isIdentifierParts(String s)
public static boolean isNumber(String s)
public static String randomString(int len)
public static void reset()
Copyright © 2012 Aarhus University