org.xerial.util
Class StringUtil

java.lang.Object
  extended by org.xerial.util.StringUtil

public class StringUtil
extends Object

A utility for manipulating Strings

Author:
leo

Field Summary
static String DOUBLE_QUOTE
           
static String NEW_LINE
           
static String SINGLE_QUOTE
           
 
Method Summary
static String concatinateWithTab(Object... data)
           
static boolean isWhiteSpace(String s)
           
static String join(Collection c, String concatinator)
          Concatinates all elements in the given collection c into a single string with the separator
static String join(Object[] c, String concatinator)
          Concatinates all elements in the given array c into a single string with the separator
static String newline()
           
static String quote(String message, String quotationMark)
          quote a given message with an quotation mark
static String unquote(String message)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SINGLE_QUOTE

public static final String SINGLE_QUOTE
See Also:
Constant Field Values

DOUBLE_QUOTE

public static final String DOUBLE_QUOTE
See Also:
Constant Field Values

NEW_LINE

public static final String NEW_LINE
Method Detail

join

public static String join(Collection c,
                          String concatinator)
Concatinates all elements in the given collection c into a single string with the separator

Parameters:
c - a collection of elements to concatenate
concatinator - a concatenator: ex. ", ", "." etc.
Returns:
a concatenated string

join

public static String join(Object[] c,
                          String concatinator)
Concatinates all elements in the given array c into a single string with the separator

Parameters:
c - an array of elements to concatenate
concatinator - a concatenator: ex. ", ", "." etc.
Returns:
the concatenated string

quote

public static String quote(String message,
                           String quotationMark)
quote a given message with an quotation mark

Parameters:
message -
quotationMark - StringUtil.SINGLE_QUOTE, StringUtil.DOUBLE_QUOTE, or other strings.
Returns:
the quoted message

unquote

public static String unquote(String message)

isWhiteSpace

public static boolean isWhiteSpace(String s)

concatinateWithTab

public static String concatinateWithTab(Object... data)

newline

public static String newline()


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.