## org.das2.util.StringTools

Utilities commonly used with strings.

## StringTools( )

## guardedSplit

guardedSplit( String str, String delim, char protect ) → String[]

splits the string, guarding the space within protect. For example, if you have a comma-separable line with quoted fields, then this can be used so that a quoted field is not split on a comma: `s= """2009,0,2,"Hot riser,spark",99"""` could be split into five fields with guardedSplit(s,',','"').

### Parameters

str - the string to split.
delim - the delimiter we split on. (similar to s.split(delim,-2))
protect - character that blocks off delimiter, such as quote.

### Returns:

a String[]
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## main

main( String[] args ) → void

### Parameters

args - a java.lang.String[]

### Returns:

void (returns nothing)
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## spaces

spaces( int count ) → String

Java 11 uses " ".repeat(n), so get Java 8 code ready for this. Also, this is efficient when there are 100 or fewer spaces, returning a subset of a constant string.

### Parameters

count - an int

### Returns:

a string of length count spaces.
[search for examples] [view on GitHub] [view on old javadoc] [view source]