|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.common11.ST
com.mindprod.common15.STA
public final class STA
Miscellaneous static methods for dealing with Strings in JDK 1.5+.
Most are reimplementations of methods from com.mindprod.common1.ST using the more efficient StringBuilder instead of StringBuffer.
Constructor Summary | |
---|---|
protected |
STA()
Dummy constructor STA contains only static methods. |
Method Summary | |
---|---|
static java.lang.String |
condense(java.lang.String s)
Collapse multiple spaces in string down to a single space. |
static void |
main(java.lang.String[] args)
Test harness, used in debugging |
static java.lang.String[] |
pruneExcessBlankLines(java.lang.String[] lines,
int minBlankLinesToKeep)
Collapse multiple blank lines down to one. |
static java.lang.String |
quoteSQL(java.lang.String sql)
used to prepare SQL string literals by doubling each embedded ' and wrapping in ' at each end. |
static java.lang.String |
squish(java.lang.String s)
Remove all spaces from a String. |
Methods inherited from class com.mindprod.common11.ST |
---|
beep, canonical, chopLeadingString, chopTrailingString, countInstances, countInstances, countLeading, countLeading, countTrailing, countTrailing, firstWord, haveCommonChar, indexOfWhiteSpace, indexOfWhiteSpace, isDigit, isEmpty, isLegal, isLegal, isLetter, isUnaccentedLowerCase, isUnaccentedUpperCase, isVowel, lastWord, leftJustified, leftPad, parseDirtyLong, parseLongPennies, penniesToString, pluck, rep, rightJustified, rightPad, spaces, toBookTitleCase, toHexString, toLowerCase, toLowerCase, toLZ, toLZ, toLZHexString, toString, toUpperCase, toUpperCase, trimLeading, trimLeading, trimLeading, trimTrailing, trimTrailing, trimTrailing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected STA()
Method Detail |
---|
public static java.lang.String condense(java.lang.String s)
s
- String to strip of blanks.
squish(String)
public static java.lang.String[] pruneExcessBlankLines(java.lang.String[] lines, int minBlankLinesToKeep)
lines
- array of lines to tidy.minBlankLinesToKeep
- usually 1 meaning 1+ consecutive blank lines become 1, effectively collapsing
runs of blank lines down to 1.
if 2, 1 blank line is removed, and 2+ consecutive blanks lines become 1,
effectively undouble spacing.
if zero, non-blank lines will be separated by one blank line, even if there was not
one there to begin with, completely independent of preexisting blank lines,
effectively double spacing..
9999 effectively removes all blank lines.
public static java.lang.String quoteSQL(java.lang.String sql)
sql
- Raw SQL string literal
public static java.lang.String squish(java.lang.String s)
s
- String to strip of blanks.
condense(String)
public static void main(java.lang.String[] args)
args
- not used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |