public class StringGrabber extends Object
| Constructor and Description |
|---|
StringGrabber() |
StringGrabber(String str) |
StringGrabber(StringGrabber sg) |
| Modifier and Type | Method and Description |
|---|---|
StringGrabber |
append(String str)
append string
|
StringGrabber |
appendRepeat(String str,
int repeatCount)
Append a string to be repeated
|
StringGrabber |
carryHead(int charCount)
To leave N character from head , cut off the rest
|
StringGrabber |
carryTail(int charCount)
To leave the tail of the N character , cut off the rest
|
StringGrabber |
copy() |
boolean |
equals(StringGrabber sg)
Compares this object to the specified object.
|
StringGrabber |
getLastPartsSeparatedBy(String separator)
returns the last part that was separated by the specified string
|
StringGrabberList |
getStringEnclosedIn(String startToken,
String endToken)
returns all of discovery that enclosed in specific tokens found in the
source string
|
StringGrabber |
getStringEnclosedInFirst(String startToken,
String endToken)
returns the first one that enclosed in specific tokens found in the
source string.
|
StringGrabber |
insertIntoHead(String str)
Insert string into the first
|
StringGrabber |
insertRepeat(String str,
int repeatCount)
Append a string to be repeated into head
|
boolean |
isEmpty()
returns true if and only if length() is 0.
|
boolean |
isNotEmpty()
returns true if and only if length() is NOT 0.
|
StringGrabber |
left(int charCount)
returns a new string that is a substring of this string from left.
|
int |
length() |
StringGrabber |
newLine()
append new line to the String
|
StringGrabber |
removeHead(int cnt)
remove from first
|
StringGrabber |
removeTail()
remove last char
|
StringGrabber |
removeTail(int cnt)
remove from tail
|
StringGrabber |
replace(String target,
String replacement)
replace specified string
|
StringGrabber |
replaceEnclosedIn(String startToken,
String endToken,
String replacement)
replace specified string enclosed in speficied token
|
StringGrabber |
replaceFirstToLowerCase()
convert first char to lower case
|
StringGrabber |
replaceFirstToUpperCase()
convert first char to upper case
|
StringGrabber |
replaceToLowerCase(int pos)
convert string in the specified position to lower case
|
StringGrabber |
replaceToLowerCase(int startPos,
int endPos)
convert string in the specified position(range) to lower case
|
StringGrabber |
replaceToUpperCase(int pos)
convert string in the specified position to upper case
|
StringGrabber |
replaceToUpperCase(int startPos,
int endPos)
convert string in the specified position(range) to upper case
|
StringGrabber |
right(int charCount)
returns a new string that is a substring of this string from right.
|
StringGrabber |
set(String str)
set new source of string to this class
|
StringGrabber |
set(StringBuilder stringBuilder)
set new source of stringbuilder to this class
|
static void |
setNewLine(String newLine)
set new line char(s) for StringGrabber
|
StringGrabberList |
split(String regexp)
Splits this string around matches of the given regular expression.
|
StringGrabber |
substring(int startIdx,
int endIndex)
returns substring specified with start index and endIndex
|
boolean |
toBoolean(boolean defaultValue)
returns boolean value ,when format error occurred ,returns default value
|
double |
toDouble(double defaultValue)
returns double value ,when format error occurred ,returns default value
|
float |
toFloat(float defaultValue)
returns float value ,when format error occurred ,returns default value
|
int |
toInt(int defaultValue)
returns int value ,when format error occurred ,returns default value
|
StringGrabber |
toLowerCase()
conver all chars to lower case
|
StringGrabberList |
toSgList()
return what was split by a newline code
|
String |
toString() |
StringGrabber |
toUpperCase()
conver all chars to upper case
|
public StringGrabber()
public StringGrabber(String str)
public StringGrabber(StringGrabber sg)
public static void setNewLine(String newLine)
newLine - public StringGrabber copy()
public StringGrabber append(String str)
str - public StringGrabber set(String str)
str - public StringGrabber set(StringBuilder stringBuilder)
stringBuilder - public StringGrabber removeTail()
StringGrabber#carryTail()public StringGrabber removeHead(int cnt)
cnt - count of charsStringGrabber#carryHead()public StringGrabber removeTail(int cnt)
cnt - count of charsStringGrabber#carryTail()public StringGrabber toLowerCase()
toUpperCase()public StringGrabber toUpperCase()
toUpperCase()public StringGrabber replaceFirstToLowerCase()
public StringGrabber replaceToLowerCase(int pos)
pos - public StringGrabber replaceToLowerCase(int startPos, int endPos)
startPos - endPos - public StringGrabber replaceFirstToUpperCase()
public StringGrabber replaceToUpperCase(int pos)
pos - public StringGrabber replaceToUpperCase(int startPos, int endPos)
startPos - endPos - public StringGrabber insertIntoHead(String str)
str - public StringGrabber left(int charCount)
cnt - public StringGrabber right(int charCount)
charCount - public StringGrabber replace(String target, String replacement)
target - replacement - public StringGrabber replaceEnclosedIn(String startToken, String endToken, String replacement)
startToken - endToken - replacement - public StringGrabber substring(int startIdx, int endIndex)
startIdx - endIndex - public int length()
public StringGrabber getLastPartsSeparatedBy(String separator)
separator - public int toInt(int defaultValue)
defaultValue - public double toDouble(double defaultValue)
defaultValue - public float toFloat(float defaultValue)
defaultValue - public boolean toBoolean(boolean defaultValue)
defaultValue - public StringGrabber appendRepeat(String str, int repeatCount)
str - repeatCount - StringGrabber#insertRepeat(String);public StringGrabber insertRepeat(String str, int repeatCount)
str - repeatCount - StringGrabber#insertRepeat(String);public StringGrabber carryHead(int charCount)
charCount - StringGrabber#removeHead()public StringGrabber carryTail(int charCount)
charCount - removeTail()public boolean isEmpty()
isNotEmpty()public boolean isNotEmpty()
isEmpty()public StringGrabber getStringEnclosedInFirst(String startToken, String endToken)
startToken - endToken - public StringGrabberList getStringEnclosedIn(String startToken, String endToken)
startToken - endToken - public StringGrabberList split(String regexp)
regexp - public StringGrabberList toSgList()
public StringGrabber newLine()
public boolean equals(StringGrabber sg)
sg - Copyright © 2015. All rights reserved.