poohbar
val s = "Hello John \nThere \n"; Pattern.compile("[ \t]+$", Pattern.DOTALL).matcher(s).replaceAll("")