Java String Split by Line splitLogLine(final String logLine)

Here you can find the source of splitLogLine(final String logLine)

Description

split Log Line

License

Open Source License

Declaration

public static ArrayList<String> splitLogLine(final String logLine) 

Method Source Code


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

import java.util.ArrayList;

public class Main {
    public static final String LOG_LINE_SEPARATOR = " ";
    public static final String EMTPY_STRING = "";

    public static ArrayList<String> splitLogLine(final String logLine) {

        String[] splitString = logLine.split(LOG_LINE_SEPARATOR);
        ArrayList<String> result = new ArrayList<>();

        for (String split : splitString) {
            if (!LOG_LINE_SEPARATOR.equals(split) && !EMTPY_STRING.equals(split)) {
                result.add(split);/*from www .  j  a v a 2 s .  co  m*/
            }
        }

        return result;
    }
}

Related

  1. splitLines(String self)
  2. splitLines(String str, int width)
  3. splitlines(String text)
  4. splitLines(String text)
  5. splitLines(String text)
  6. splitMultiline(String text, boolean trimLines)
  7. splitNewLines(final String input)
  8. splitNextWord(String line)
  9. splitString(String line)