Java String Split splitGenericIfNeeded(String name)

Here you can find the source of splitGenericIfNeeded(String name)

Description

split Generic If Needed

License

Open Source License

Declaration

public static List<String> splitGenericIfNeeded(String name) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

public class Main {
    public static List<String> splitGenericIfNeeded(String name) {

        List<String> result = new ArrayList<>();
        if (name.contains("<")) {

            result.add(name.substring(0, name.indexOf("<")).trim());

            for (String item : Arrays.asList(name.substring(name.indexOf("<") + 1, name.indexOf(">")).split(","))) {
                result.add(item.trim());
            }//from w  ww .  j  a va  2s .c  om
        } else {
            result.add(name);
        }

        return result;

    }
}

Related

  1. splitDomains(String domains)
  2. splitElements(String values)
  3. splitEx(String str, String spilter)
  4. splitFields(String fieldsString, int minNum)
  5. splitForIndexMatching(String string)
  6. splitHelperName(String name)
  7. splitHistory(String history)
  8. splitHTMLTags(final String string)
  9. splitIdKeyConfig(String config)