MCPcopy Create free account
hub / github.com/RealTimeGenomics/rtg-tools / splitLines

Method splitLines

src/test/java/com/rtg/util/TestUtils.java:603–616  ·  view source on GitHub ↗

Take a string of LS (either platform) separated strings and split them into an array containing one string per line. @param in string of lines to be split. @return an array containing individual lines.

(final String in)

Source from the content-addressed store, hash-verified

601 * @return an array containing individual lines.
602 */
603 public static String[] splitLines(final String in) {
604 //return StringUtils.LS.equals("\n") ? in.split("\\\n") : in.split("\\\r\\\n"); //there must be a better way
605 final BufferedReader sr = new BufferedReader(new StringReader(in));
606 final ArrayList<String> results = new ArrayList<>();
607 String line;
608 try {
609 while ((line = sr.readLine()) != null) {
610 results.add(line);
611 }
612 } catch (final IOException ioe) {
613 throw new RuntimeException(ioe);
614 }
615 return results.toArray(new String[0]);
616 }
617
618 /**
619 * Take a string of LS separated strings and sort them and return them as a concatenated (LS separated) string.

Callers 10

checkRocResultsMethod · 0.95
checkSvgMethod · 0.95
testSampleSimulatorMethod · 0.95
testSampleSimulatorMethod · 0.95
sortLinesMethod · 0.95
unwrapMethod · 0.95
sameLinesMethod · 0.95
startLinesMethod · 0.95
SharedSamConstantsClass · 0.95

Calls 2

readLineMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected