Class STRINGImpl<C extends IComponent<C>>
java.lang.Object
io.ciera.runtime.summit.util.Utility<C>
io.ciera.runtime.summit.util.impl.STRINGImpl<C>
- All Implemented Interfaces:
IActionHome<C>
,STRING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Convert a string to an integer.escapetics
(String s) Replace all single quotes with two single quotes for escaping SQL insert statements.int
Gets the index of the first occurance ofneedle
inhaystack
.itoa
(int i) Convert an integer to a string.quote()
Return a literal double quote.replaceall
(String s, String pattern, String replacement) Replace all occurances ofpattern
with onereplacement
quote for unescaping SQL insert statements.int
Get the length of a stringGet a substring of an input string frombegin
(inclusive) toend
(exclusive).Trim whitespace from the start and end of a string.Replace all occurances of two adjacent single quotes with one single quote for unescaping SQL insert statements.Methods inherited from class io.ciera.runtime.summit.util.Utility
context, getRunContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.ciera.runtime.summit.application.IActionHome
warn
-
Constructor Details
-
STRINGImpl
-
-
Method Details
-
itoa
Description copied from interface:STRING
Convert an integer to a string. -
atoi
Description copied from interface:STRING
Convert a string to an integer.- Specified by:
atoi
in interfaceSTRING
- Parameters:
s
- the string to parse- Returns:
- the integer representation of the input string
- Throws:
XtumlException
- if the string cannot be parsed to an integer.
-
substr
Description copied from interface:STRING
Get a substring of an input string frombegin
(inclusive) toend
(exclusive). Ifbegin < 0
, the result is a substring starting at the beginning ofs
. Ifbegin >
the length ofs - 1
, the result is an empty string. Ifend < 0
or>
the length ofs
, the result is a substring starting atbegin
to the end ofs
. Ifend <= begin
, the result is an empty string. -
strlen
Description copied from interface:STRING
Get the length of a string -
indexof
Description copied from interface:STRING
Gets the index of the first occurance ofneedle
inhaystack
. Returns -1 ifneedle
is not contained inhaystack
. -
trim
Description copied from interface:STRING
Trim whitespace from the start and end of a string. -
quote
Description copied from interface:STRING
Return a literal double quote. -
escapetics
Description copied from interface:STRING
Replace all single quotes with two single quotes for escaping SQL insert statements.- Specified by:
escapetics
in interfaceSTRING
- Parameters:
s
- the input string- Returns:
- the input string with all single quotes replaced with two single quotes
-
unescapetics
Description copied from interface:STRING
Replace all occurances of two adjacent single quotes with one single quote for unescaping SQL insert statements.- Specified by:
unescapetics
in interfaceSTRING
- Parameters:
s
- the input string- Returns:
- the input string with all occurances of two adjacent single quotes replaced with one single quote
-
replaceall
Description copied from interface:STRING
Replace all occurances ofpattern
with onereplacement
quote for unescaping SQL insert statements.- Specified by:
replaceall
in interfaceSTRING
- Parameters:
s
- the input stringreplacement
- the string to insert- Returns:
- the input string with all occurances of two adjacent single quotes replaced with one single quote
-