Here you can find the source of getOutputFromValgrindOutput(String valgrindOutput)
private static String getOutputFromValgrindOutput(String valgrindOutput)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { private static String getOutputFromValgrindOutput(String valgrindOutput) { StringBuilder programOutput = new StringBuilder(); Scanner scanner = new Scanner(valgrindOutput); while (scanner.hasNextLine()) { String line = scanner.nextLine(); if (!line.startsWith("==")) { programOutput.append(line); programOutput.append(System.getProperty("line.separator")); }//from w w w . j a v a 2 s . c om } return programOutput.toString(); } }