Java String Split splitHistory(String history)

Here you can find the source of splitHistory(String history)

Description

Split history string to history path using HISTORY_SEP as the separator

License

LGPL

Parameter

Parameter Description
history a parameter

Return

the history path

Declaration

public static List<String> splitHistory(String history) 

Method Source Code

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

import java.util.Arrays;
import java.util.List;

public class Main {
    public static final String HISTORY_SEP = "/";
    public static final String HISTORY_SEP_REGEX = "/";

    /**/*  w w  w  .j a  v  a2s. c om*/
     * Split history string to history path using HISTORY_SEP as the separator
     * 
     * @param history
     * @return the history path
     */
    public static List<String> splitHistory(String history) {
        List<String> historyPath;
        if (history.indexOf(HISTORY_SEP) == -1) {
            historyPath = Arrays.asList(history);
        } else {
            historyPath = Arrays.asList(history.split(HISTORY_SEP_REGEX));
        }
        return historyPath;
    }
}

Related

  1. splitEx(String str, String spilter)
  2. splitFields(String fieldsString, int minNum)
  3. splitForIndexMatching(String string)
  4. splitGenericIfNeeded(String name)
  5. splitHelperName(String name)
  6. splitHTMLTags(final String string)
  7. splitIdKeyConfig(String config)
  8. splitInitialItems(final String text)
  9. splitInput(String cliInput)