public static float[] stringToFloatArray(String str){
  if (str == null) {
    return (null);
  }
  String[] array=str.split(",");
  if (array.length == 0) {
    array=new String[]{str.trim()};
  }
  float[] nArray=new float[array.length];
  for (int i=0; i < nArray.length; ++i) {
    nArray[i]=Float.parseFloat(array[i]);
  }
  return (nArray);
}

public static float [ ] stringToFloatArray ( String str ) { if ( str == null ) { return ( null ) ; } String [ ] array = str . split ( "," ) ; if ( array . length == 0 ) { array = new String [ ] { str . trim ( ) } ; } float [ ] nArray = new float [ array . length ] ; for ( int i = 0 ; i < nArray . length ; ++ i ) { nArray [ i ] = Float . parseFloat ( array [ i ] ) ; } return ( nArray ) ; }
convert a string to a float array
