Here you can find the source of splitKeepDelimiter(String delimiter, String input)
public static List<String> splitKeepDelimiter(String delimiter, String input)
//package com.java2s; //License from project: Open Source License import java.util.Arrays; import java.util.List; public class Main { public static List<String> splitKeepDelimiter(String delimiter, String input) { return Arrays.asList(input.split(// "(?i)" // case insensitive + "((?<="// + delimiter// + ")|(?="// + delimiter// + "))"// ));/*from w w w . j av a 2 s . c o m*/ } }