String.replaceAll with closure: added description, fixed minor formatting. Eliminate unnnecessary string copy in case when we have nothing to replace.