Java String Split by Line splitLines(String s)

Here you can find the source of splitLines(String s)

Description

Splits a string of text into a list of new segments, using the splitter "!n."

License

Open Source License

Parameter

Parameter Description
s - string to split

Return

split string

Declaration

public static List<String> splitLines(String s) 

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 {
    /**//from  w  w w  .j a v a2 s  .  c o  m
     * Splits a string of text into a list of new segments, using the splitter "!n."
     * @param s - string to split
     * @return split string
     */
    public static List<String> splitLines(String s) {
        ArrayList ret = new ArrayList();

        String[] split = s.split("!n");
        ret.addAll(Arrays.asList(split));

        return ret;
    }
}

Related

  1. SplitLine(String p_line, String p_delimiter)
  2. splitLines(final String helpMessage)
  3. splitLines(final String string)
  4. splitLines(String raw, int limit)
  5. splitLines(String S)
  6. splitLines(String self)
  7. splitLines(String str, int width)
  8. splitlines(String text)
  9. splitLines(String text)