Java String Tokenize tokenize(String[] stringArray, String delimiter)

Here you can find the source of tokenize(String[] stringArray, String delimiter)

Description

tokenize

License

Apache License

Declaration

public static String tokenize(String[] stringArray, String delimiter) 

Method Source Code

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

public class Main {
    public static String tokenize(String[] stringArray, String delimiter) {
        StringBuffer bufferedString = new StringBuffer();

        for (int idx = 0; idx < stringArray.length; idx++) {
            if ((idx + 1) != stringArray.length) {
                bufferedString.append(stringArray[idx]).append(delimiter);
            } else {
                bufferedString.append(stringArray[idx]);
            }//  www.  j a  va2s .com
        }

        return bufferedString.toString();
    }

    @SuppressWarnings("rawtypes")
    public static String tokenize(Enum[] enumArray, String delimiter) {
        StringBuffer bufferedString = new StringBuffer();

        for (int idx = 0; idx < enumArray.length; idx++) {
            if ((idx + 1) != enumArray.length) {
                bufferedString.append(enumArray[idx].toString().toLowerCase()).append(delimiter);
            } else {
                bufferedString.append(enumArray[idx]);
            }
        }

        return bufferedString.toString();
    }
}

Related

  1. tokenize(String text, char separator)
  2. tokenize(String text, char separator)
  3. tokenize(String text, String delimiter)
  4. tokenize(String value)
  5. tokenize(String value)
  6. tokenizeAutocomplete(String text, int minSize)
  7. tokenizeClassName(final String className)
  8. tokenizeDirectiveCall(String data)
  9. tokenizeExpression(String s)