Java tutorial
//package com.java2s; public class Main { private static String prepare(String unprepared) { return unprepared.replaceAll("\\s{2,}", "").replaceAll("\\n", ""); } }