public class StringUtil extends Object
Constructor and Description |
---|
StringUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
appendN(char c,
int n,
StringBuilder sb)
Appends the specified character n times to the supplied StringBuilder.
|
static String |
concat(String... strings)
Deprecated.
|
static String[] |
decodeArray(String encodedArray)
Deprecated.
|
static String |
deriveInitialText(String text)
Deprecated.
|
static String |
encodeArray(String[] array)
Deprecated.
|
static String |
getAllAfter(String string,
char separatorChar)
Deprecated.
|
static String |
getAllBefore(String string,
char separatorChar)
Deprecated.
|
static String |
gsub(String olds,
String news,
String text)
Substitute String "old" by String "new" in String "text" everywhere.
|
static boolean |
isGarbageText(String text)
Deprecated.
|
static void |
simpleEscapeIRI(String str,
Appendable appendable,
boolean escapeUnicode)
Escapes a string to a (mostly) conforming IRI value and append it to the appendable.
|
static String |
trimDoubleQuotes(String text)
Removes the double quote from the start and end of the supplied string if it starts and ends with this character.
|
public static String gsub(String olds, String news, String text)
olds
- The String to be substituted.news
- The String is the new content.text
- The String in which the substitution is done.public static void simpleEscapeIRI(String str, Appendable appendable, boolean escapeUnicode) throws IOException
ParsedIRI.create(String)
for valid IRI (without
percents) and much faster for IRI with invalid (percent-encoded) characters, though it is less accurate.str
- appendable
- escapeUnicode
- escape non-ASCII values numericallyIOException
@Deprecated public static String getAllAfter(String string, char separatorChar)
string
- The string of which the substring needs to be determined.separatorChar
- The character to look for.@Deprecated public static String getAllBefore(String string, char separatorChar)
string
- The string of which the substring needs to be determined.separatorChar
- The character to look for.@Deprecated public static String encodeArray(String[] array)
array
- array of strings@Deprecated public static String[] decodeArray(String encodedArray)
encodedArray
- @Deprecated public static String deriveInitialText(String text)
text
- @Deprecated public static boolean isGarbageText(String text)
text
- public static void appendN(char c, int n, StringBuilder sb)
c
- The character to append.n
- The number of times the character should be appended.sb
- The StringBuilder to append the character(s) to.public static String trimDoubleQuotes(String text)
text
- The string to remove the double quotes from.@Deprecated public static String concat(String... strings)
strings
- the String to concatenateCopyright © 2015-2022 Eclipse Foundation. All Rights Reserved.