class Const {

  public static String[] splitString( String string, String separator ) {
    /*
     * 0123456 Example a;b;c;d --> new String[] { a, b, c, d }
     */
    // System.out.println("splitString ["+path+"] using ["+separator+"]");
    List<String> list = new ArrayList<>();

    if ( string == null || string.length() == 0 ) {
      return new String[] {};
    }

    int sepLen = separator.length();
    int from = 0;
    int end = string.length() - sepLen + 1;

    for ( int i = from; i < end; i += sepLen ) {
      if ( string.substring( i, i + sepLen ).equalsIgnoreCase( separator ) ) {
        // OK, we found a separator, the string to add to the list
        // is [from, i[
        list.add( NVL( string.substring( from, i ), "" ) );
        from = i + sepLen;
      }
    }

    // Wait, if the string didn't end with a separator, we still have information at the end of the string...
    // In our example that would be "d"...
    if ( from + sepLen <= string.length() ) {
      list.add( NVL( string.substring( from, string.length() ), "" ) );
    }

    return list.toArray( new String[list.size()] );
  }

}