Here you can find the source of splitIntoNonEmptyLinesWithoutNetLogoComments( String s)
public static ArrayList<String> splitIntoNonEmptyLinesWithoutNetLogoComments( String s)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<String> splitIntoNonEmptyLinesWithoutNetLogoComments( String s) {//from ww w .j a v a 2 s . co m return removeNetLogoCommentsAndEmptyLines(s.split("\n")); } public static ArrayList<String> removeNetLogoCommentsAndEmptyLines( String lines[]) { ArrayList<String> result = new ArrayList<String>(); for (int i = 0; i < lines.length; i++) { String line; int semicolon = lines[i].indexOf(';'); if (semicolon < 0) { line = lines[i]; } else { line = lines[i].substring(0, semicolon); } if (!line.trim().isEmpty()) { result.add(line); } } return result; } }