Android String Split splitString(String tokenedStr, String token)

Here you can find the source of splitString(String tokenedStr, String token)

Description

split String

Declaration

public static String[] splitString(String tokenedStr, String token) 

Method Source Code

//package com.java2s;

import java.util.StringTokenizer;

public class Main {

    public static String[] splitString(String tokenedStr, String token) {
        String[] ids = null;//from  w w w.  j  av  a 2s  . c o m
        if (tokenedStr != null) {
            StringTokenizer st = new StringTokenizer(tokenedStr, token);
            final int arraySize = st.countTokens();
            if (arraySize > 0) {
                ids = new String[arraySize];
                int counter = 0;
                while (st.hasMoreTokens()) {
                    ids[counter++] = st.nextToken();
                }
            }
        }
        return ids;
    }
}

Related

  1. split(final String str, final String delim)
  2. splitDirString(String dirSection)
  3. splitInts(String str)
  4. splitLast(String target, String pattern)
  5. splitSteps(String str, String split)
  6. explode(String original, String split)
  7. getFirstWord(String str)
  8. getLine(String text, int line)
  9. stringToLongArray(String src, String separator)