Java Utililty Methods String Split

List of utility methods to do String Split

Description

The list of methods to do String Split are organized into topic(s).

Method

ListsplitOnNoWiki(String s)
_more_
List<String> content = new ArrayList<String>();
int idx = s.indexOf("<nowiki>");
int tagLength1 = "<nowiki>".length();
int tagLength2 = "</nowiki>".length();
while ((idx >= 0) && (s.length() > 0)) {
    content.add(s.substring(0, idx));
    s = s.substring(idx + tagLength1);
    int idx2 = s.indexOf("</nowiki>");
...
String[]splitOnTokens(String text)
split On Tokens
char[] array = text.toCharArray();
if (text.indexOf("?") == -1 && text.indexOf("*") == -1) {
    return new String[] { text };
ArrayList list = new ArrayList();
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < array.length; i++) {
    if (array[i] == '?' || array[i] == '*') {
...
String[]splitOnTokens(String text)
Splits a string into a number of tokens.
if (text.indexOf('?') == -1 && text.indexOf('*') == -1) {
    return new String[] { text };
char[] array = text.toCharArray();
ArrayList<String> list = new ArrayList<String>();
StringBuilder buffer = new StringBuilder();
for (int i = 0; i < array.length; i++) {
    if (array[i] == '?' || array[i] == '*') {
...
ListsplitOrderedDurationsIntoIntervals(String[] durations, int numberOfIntervals)
split Ordered Durations Into Intervals
int sizeOfSmallSublists = durations.length / numberOfIntervals;
int sizeOfLargeSublists = sizeOfSmallSublists + 1;
int numberOfLargeSublists = durations.length % numberOfIntervals;
int numberOfSmallSublists = numberOfIntervals - numberOfLargeSublists;
List<String[]> sublists = new ArrayList<String[]>(numberOfIntervals);
int numberOfElementsHandled = 0;
for (int i = 0; i < numberOfIntervals; i++) {
    int size = i < numberOfSmallSublists ? sizeOfSmallSublists : sizeOfLargeSublists;
...
ListsplitPackageName(String packageName)
split Package Name
List<String> result = new ArrayList<>();
int end = packageName.indexOf('.');
while (end > 0) {
    result.add(packageName.substring(0, end));
    end = packageName.indexOf('.', end + 1);
result.add(packageName);
return result;
...
ListsplitPackages(String packages)
Splits the packages list into a List of individual relevant packages or Classes.
return Arrays.asList(packages.trim().split("\\s*,\\s*"));
String[]splitParagraphs(String value)
Processes a doc comment into paragraphs.
String[] lines = split(value, '\n');
for (int i = 0; i < lines.length; i++) {
    lines[i] = lines[i].trim();
ArrayList<String> output = new ArrayList<>();
StringBuilder current = new StringBuilder();
for (String line : lines) {
    if (line.length() == 0) {
...
ListsplitParameters(String parameters)
split Parameters
List<String> pList = new ArrayList<String>();
int idx = 0;
boolean object = false;
String curr = "";
while (idx < parameters.length()) {
    char c = parameters.charAt(idx);
    curr += c;
    switch (c) {
...
String[]splitParameters(String parameterString)
Tokenise the comma-separated parameters of a command line, respecting commas in quoted sections.
if (parameterString.indexOf(COMMA) == -1) {
    return new String[] { parameterString };
else if (parameterString.indexOf(QUOTE) == -1) {
    return parameterString.split(",");
List<String> resultList = new ArrayList<String>();
boolean inQuotedToken = false;
...
ListsplitParameterString(String theInput, boolean theUnescapeComponents)
split Parameter String
return splitParameterString(theInput, ',', theUnescapeComponents);