|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.util.Strings
public final class Strings
A utility class with some useful functions to manipulate String objects.
| Field Summary | |
|---|---|
static String |
COPYRIGHT
represents the symbol for use in HTML or XML |
static String |
EURO
represents the Euro currency symbol |
static String |
fs
convenient access to the platform dependent file separator |
static String |
lb
convenient access to the platform dependent line separator |
static String |
LEFT_DOUBLE_QUOTE
represents the symbol for use in HTML or XML |
static String |
REGISTERED_TM
represents the symbol for use in HTML or XML |
static String |
RIGHT_DOUBLE_QUOTE
represents the symbol for use in HTML or XML |
static String |
TRADEMARK
represents the symbol for use in HTML or XML |
static String |
XML_HEADER
xml header line with utf8 |
| Method Summary | |
|---|---|
static String |
asPercent(double d)
|
static boolean |
containsIgnoreCase(String text,
String pattern)
returns indexOfIgnoreCase(text, pattern) >= 0 |
static int |
count(String text,
String pattern)
counts how many times the given pattern occurs in the given text. |
static int |
countIgnoreCase(String text,
String pattern)
counts how many times the given pattern occurs in the given text. |
static String |
decode64(String s)
decodes the given String using Base64 assuming ASCII character set |
static String |
decodeURL(String s)
uses URLEncoder using UTF8 |
static String |
decodeXML(String text)
decodes an HTML or XML text sequence into human readable form using the translateArray |
static String |
encode64(String s)
encodes the given String using Base64 with ASCII |
static String |
encodeURL(String s)
uses URLEncoder using UTF8 |
static String |
encodeXML(String text)
encodes a text string to use as text in an HTML or XML document using the translateArray |
static String |
hash(String s)
returns a human readable digest of the given string based on MD5 and ASCII encoding |
static String |
hexString(byte... bytes)
|
static byte[] |
hexToBytes(String s)
|
static int |
indexOfIgnoreCase(String textToSearch,
String pattern)
calls the method with the same name adding index 0 |
static int |
indexOfIgnoreCase(String textToSearch,
String pattern,
int fromIndex)
|
static String |
mapAsString(Map map)
|
static String |
mapAsString(Map map,
String fieldSeparator,
String lineSeparator)
|
static String |
replaceAll(String original,
String oldSubString,
String newSubString)
Deprecated. as of Java version 1.5 |
static String |
replaceAllIgnoreCase(String original,
String oldSubString,
String newSubString)
replaces every occurrence of oldSubString (ignoring case) with newSubString within the original String and returns the resulting string (no regular expressions are used) |
static boolean |
same(String s1,
String s2)
returns true only if the the both strings are equal or null, false otherwise. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String lb
public static final String fs
public static final String EURO
public static final String XML_HEADER
public static final String LEFT_DOUBLE_QUOTE
public static final String RIGHT_DOUBLE_QUOTE
public static final String TRADEMARK
public static final String REGISTERED_TM
public static final String COPYRIGHT
| Method Detail |
|---|
public static String hash(String s)
@Deprecated
public static String replaceAll(String original,
String oldSubString,
String newSubString)
String.replace(CharSequence, CharSequence)
public static String replaceAllIgnoreCase(String original,
String oldSubString,
String newSubString)
public static int indexOfIgnoreCase(String textToSearch,
String pattern)
public static int indexOfIgnoreCase(String textToSearch,
String pattern,
int fromIndex)
public static int count(String text,
String pattern)
count("ababababab", "abab") returns 2.
public static int countIgnoreCase(String text,
String pattern)
count("aBabABabab", "aBAb") returns 2.
public static boolean containsIgnoreCase(String text,
String pattern)
indexOfIgnoreCase(text, pattern) >= 0
public static String encodeXML(String text)
translateArray
public static String decodeXML(String text)
translateArray
public static String encodeURL(String s)
public static String decodeURL(String s)
public static String mapAsString(Map map)
public static String mapAsString(Map map,
String fieldSeparator,
String lineSeparator)
public static String asPercent(double d)
public static String hexString(byte... bytes)
hexToBytes(String)
public static byte[] hexToBytes(String s)
throws NumberFormatException
NumberFormatException - if the String cannot be parsed properlyhexToBytes(String)public static String encode64(String s)
public static String decode64(String s)
throws IOException
IOException
public static boolean same(String s1,
String s2)
Misc.same(Object, Object)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||