Top Fields Constructors Methods
org.codehaus.groovy.tools

public Class StringHelper

extends Object
Class Inheritance
Imports
java.util.LinkedList, .List

Field Summary

Modifier and TypeField and Description
private static final char
private static final String[]
private static final char
private static final char

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
scanQuoted(String s, int pos0, char quote)

private static int
scanToken(String s, int pos0)

private static int
skipWhitespace(String s, int pos0)

public static String[]

Returns:

the tokens
tokenizeUnquoted
(String
the string to tokenize
s
)

This method tokenizes a string by space characters, but ignores spaces in quoted parts,that are parts in '' or "".

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DOUBLE_QUOTEback to summary
private static final char DOUBLE_QUOTE
EMPTY_STRING_ARRAYback to summary
private static final String[] EMPTY_STRING_ARRAY
SINGLE_QUOTEback to summary
private static final char SINGLE_QUOTE
SPACEback to summary
private static final char SPACE

Constructor Detail

StringHelperback to summary
public StringHelper()

Method Detail

scanQuotedback to summary
private static int scanQuoted(String s, int pos0, char quote)
scanTokenback to summary
private static int scanToken(String s, int pos0)
skipWhitespaceback to summary
private static int skipWhitespace(String s, int pos0)
tokenizeUnquotedback to summary
public static String[] tokenizeUnquoted(String s)

This method tokenizes a string by space characters, but ignores spaces in quoted parts,that are parts in '' or "". The method does allows the usage of "" in '' and '' in "". The space character between tokens is not returned.

Parameters
s:String

the string to tokenize

Returns:String[]

the tokens