|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.util.StringUtils
public class StringUtils
This class provides a set of string utility methods.
Method Summary | |
---|---|
static int |
countNL(String in)
Counts the number of NL in the given in string. |
static int |
countOccurrences(String container,
String content)
Counts how many times content appears within container
without string overlapping. |
static String |
escapeAsJSONString(String in)
Escapes the in string as JSON string
to let it being embeddable within a string field. |
static String |
escapeDoubleQuotes(String in)
Escapes all the unescaped double quotes when needed. |
static boolean |
isPrefix(String candidatePrefix,
String container)
Check whether string candidatePrefix is prefix of string container . |
static boolean |
isSuffix(String candidateSuffix,
String container)
Check whether string candidateSuffix is suffix of string container . |
static String |
join(String delimiter,
String... data)
Joins the given input sting data list
using the specified delimiter . |
static String |
multiply(char c,
int times)
Builds a string composed of the given char c |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String join(String delimiter, String... data)
data
list
using the specified delimiter
.
delimiter
- string delimiter.data
- list of data to be joined.
public static int countOccurrences(String container, String content)
content
appears within container
without string overlapping.
container
- container string.content
- content string.
public static int countNL(String in)
NL
in the given in string.
in
- input string.
public static boolean isPrefix(String candidatePrefix, String container)
candidatePrefix
is prefix of string container
.
candidatePrefix
- container
-
public static boolean isSuffix(String candidateSuffix, String container)
candidateSuffix
is suffix of string container
.
candidateSuffix
- container
-
public static String escapeDoubleQuotes(String in)
in
- input string.
public static String escapeAsJSONString(String in)
in
string as JSON string
to let it being embeddable within a string field.
in
- string to be escaped.
public static String multiply(char c, int times)
c
n
times.
- Parameters:
c
- char to be multiplied.times
- number of times.
- Returns:
- the string containing the multiplied char.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |