public final class StringUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
private static Map<Character,String> |
CHAR2STR |
| Modifier | Constructor and Description |
|---|---|
private |
StringUtil() |
| Modifier and Type | Method and Description |
|---|---|
private static void |
appendChar(StringBuffer buf,
char c) |
static String |
jQuote(char[] cbuf,
int len)
Quotes the first
len characters of cbuf
as Java Language string literal. |
static String |
jQuote(String str)
Quotes string as Java Language string literal.
|
static boolean |
parseBoolean(String line) |
static double |
parseDouble(String string)
This is almost the same as Double.parseDouble(),
but it handles a few more versions of infinity.
|
static String |
toString(boolean bool)
Returns the string representation of booleans in octave:
1 for true and 0 for false.
|
static <T> String |
toString(T obj)
Returns the string representation of the object
obj
which is defined also for null returning just "null". |
private static void appendChar(StringBuffer buf, char c)
public static String jQuote(String str)
null" (with length 4)
if str is null.
Code taken from http://freemarker.sourceforge.net/str - public static String jQuote(char[] cbuf, int len)
len characters of cbuf
as Java Language string literal.
Returns string null if s is null.cbuf - the bufferlen - How much of the buffer to quote"public static boolean parseBoolean(String line)
public static String toString(boolean bool)
public static <T> String toString(T obj)
obj
which is defined also for null returning just "null".public static double parseDouble(String string)
string - Copyright © 2006–2018 Simuline Organization (l2r). All rights reserved.