Java Utililty Methods String Split by Line

List of utility methods to do String Split by Line

Description

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

Method

ListsplitLine(String input, int splitPosition)
split Line
List<String> lines = new ArrayList<String>();
StringBuilder stringBuilder = new StringBuilder(input.trim());
boolean linesRemaining = true;
while (linesRemaining) {
    if (stringBuilder.length() <= splitPosition || stringBuilder.lastIndexOf(" ") < splitPosition) {
        lines.add(stringBuilder.toString());
        linesRemaining = false;
    } else {
...
VectorSplitLine(String p_line, String p_delimiter)
Split Line
Vector<String> t_values = new Vector<String>();
String t_newValue;
int t_valueIndex = 0;
int t_lastDelimiterIndex = -1;
int t_nextDelimiterIndex = p_line.indexOf(p_delimiter);
while (t_nextDelimiterIndex >= 0) {
    t_values.add(t_valueIndex++, p_line.substring(t_lastDelimiterIndex + 1, t_nextDelimiterIndex).trim());
    t_lastDelimiterIndex = t_nextDelimiterIndex;
...
ListsplitLines(final String helpMessage)
split Lines
return Arrays.asList(helpMessage.split(lineSeparator));
ListsplitLines(final String string)
Splits the given string in a list where each element is a line.
final List<String> ret = new ArrayList<>();
final int len = string.length();
char c;
final StringBuilder buf = new StringBuilder();
for (int i = 0; i < len; i++) {
    c = string.charAt(i);
    buf.append(c);
    if (c == '\r') {
...
ListsplitLines(String raw, int limit)
split Lines
String[] lines = raw.split("\n");
List<String> result = new ArrayList<>();
int count = 0;
for (String line : lines) {
    line = line.trim();
    if (!line.isEmpty()) {
        if (count > 0 && count == limit) {
            break;
...
ListsplitLines(String S)
Splits a String into lines on any '\n' characters.
List<String> V = new ArrayList<>();
int start = 0;
int pos;
while ((pos = S.indexOf('\n', start)) != -1) {
    String line;
    if (pos > start && S.charAt(pos - 1) == '\r')
        line = S.substring(start, pos - 1);
    else
...
ListsplitLines(String s)
Splits a string of text into a list of new segments, using the splitter "!n."
ArrayList ret = new ArrayList();
String[] split = s.split("!n");
ret.addAll(Arrays.asList(split));
return ret;
ListsplitLines(String self)
split Lines
List lines = new ArrayList<String>(16);
int len = self.length();
int s = 0;
for (int i = 0; i < len; ++i) {
    int c = self.charAt(i);
    if (c == '\n' || c == '\r') {
        lines.add(self.substring(s, i));
        s = i + 1;
...
String[]splitLines(String str, int width)
split Lines
List<String> res = new ArrayList<>();
StringBuilder b = new StringBuilder();
int llen = 0;
int i = 0;
while (i < str.length()) {
    int wlen = nextTestWhitespaceLength(false, str, i);
    if (wlen > 0) {
        String word = str.substring(i, i + wlen);
...
String[]splitlines(String text)
splitlines
ArrayList<String> ret = new ArrayList<String>();
int p = 0;
while (true) {
    int p2 = text.indexOf('\n', p);
    if (p2 < 0) {
        ret.add(text.substring(p));
        break;
    ret.add(text.substring(p, p2));
    p = p2 + 1;
return (ret.toArray(new String[0]));