Java Array Create toArray(String source, String delimiter)

Here you can find the source of toArray(String source, String delimiter)

Description

to Array

License

Apache License

Declaration

public static String[] toArray(String source, String delimiter) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static String[] toArray(String source, String delimiter) {
        if (isEmpty(source)) {
            return new String[0];
        } else {/*from   w  w  w  .  j av a2s. com*/
            return source.split(delimiter);
        }
    }

    public static boolean isEmpty(String value) {
        return value == null || value.length() == 0;
    }
}

Related

  1. newArray(Class elementType, int length)
  2. newArray(int length, double start, double increment)
  3. newArray(Object obj, int size)
  4. newArray(Object src, int len)
  5. newArray(String... args)
  6. toArray(String str)
  7. toArray(String str)
  8. toArray(String str, String split)
  9. toArray(String string)