org.csstudio.java.string
Class StringSplitter

java.lang.Object
  extended by org.csstudio.java.string.StringSplitter

public class StringSplitter
extends java.lang.Object

Split string into segments

Author:
Kay Kasemir, Xihui Chen - Original StringUtil.splitIgnoreInQuotes()

Method Summary
static java.lang.String[] splitIgnoreInQuotes(java.lang.String source, char splitChar, boolean deleteHeadTailQuotes)
          Split source string into an array of elements separated by the splitting character, but ignoring split characters enclosed in quotes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

splitIgnoreInQuotes

public static java.lang.String[] splitIgnoreInQuotes(java.lang.String source,
                                                     char splitChar,
                                                     boolean deleteHeadTailQuotes)
                                              throws java.lang.Exception
Split source string into an array of elements separated by the splitting character, but ignoring split characters enclosed in quotes.

Parameters:
trimmedSource - String to be split
splitChar - Character used to split the source string, e.g. ',' or ' '
deleteHeadTailQuotes - Delete quotes in the head and tail of individual elements if true
Returns:
Array of individual elements
Throws:
java.lang.Exception - on parse error (missing end of quoted string)