public class StringUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String[] |
split(java.lang.String line,
char separator)
This is a more optimized version of String.split() that doesn't require
compiling and evaluating regular expression patterns to do it, thereby
saving chunks of transient heap (and probably some CPU time as well).
|
static java.lang.String[] |
splitCSV(java.lang.String line)
This is a more optimized version of String.split() that doesn't require
compiling and evaluating regular expression patterns to do it, thereby
saving chunks of transient heap (and probably some CPU time as well); this version
recognizes quoting and only uses commas as delimiters.
|
static java.lang.String |
trim(java.lang.String s)
Trim leading and trailing whitespace from a String like
java.lang.String's trim() method, except it recognizes all
Unicode whitespace characters instead of just ISO-Latin-1.
|
static java.lang.String |
trim(java.lang.String s,
int left,
int right)
Trim leading and trailing whitespace from a String like
java.lang.String's trim() method, except it recognizes all
Unicode whitespace characters instead of just ISO-Latin-1.
|
static java.lang.String |
trimWithUnderscore(java.lang.String s)
The leading and trailing whitespace from a string like
java.langString's trim() method, except it recognizes all
Unicode whitespace characters instead of just ISO-Latin-1, and also
trims leading and trailing underscores (for text that had whitespace
replaced with underscores).
|
public static java.lang.String trim(java.lang.String s)
s
- String to trimpublic static java.lang.String trim(java.lang.String s, int left, int right)
s
- String to trimleft
- zero-based left-end starting positionright
- zero-based right-end starting positionpublic static java.lang.String trimWithUnderscore(java.lang.String s)
s
- String to trimpublic static java.lang.String[] split(java.lang.String line, char separator)
This method was originally (and still is) in the AX25Message
class, but really belongs in a more general class. It was also left in its
original place for backwards compatibility.
line
- the String to split at occurrences of the separatorseparator
- the String delimiting substrings of the linepublic static java.lang.String[] splitCSV(java.lang.String line)
line
- the String to split at occurrences of the separator