edu.mayo.bsi.ngsportal.shared
Class SplitFile

java.lang.Object
  extended by edu.mayo.bsi.ngsportal.shared.SplitFile

public class SplitFile
extends Object

Author:
Greg Dougherty

Field Summary
static int kReturnAll
          Constant to say want String.split to find every possible split in a String.
 
Constructor Summary
SplitFile()
           
 
Method Summary
static String[] mySplit(String target, String split, int maxCol)
          Return an array of strings split on the string split.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

kReturnAll

public static final int kReturnAll
Constant to say want String.split to find every possible split in a String.

See Also:
Constant Field Values
Constructor Detail

SplitFile

public SplitFile()
Method Detail

mySplit

public static final String[] mySplit(String target,
                                     String split,
                                     int maxCol)
Return an array of strings split on the string split. Unlike the String class version of this function, split is not treated as a regular expression

Parameters:
target - string to split up
split - string with which to do the splitting
maxCol - maximum number of columns to return. -1 to return all
Returns:
an empty array if target is length 0, otherwise an array with n + 1 strings, where n is the number of occurrences of split. Will only return n strings if the final occurrence of split is at the end of target.