class StringHelper {

    public static String trimLines(String text) {
        if (text == null) {
            return null;
        }
        return text.replaceAll("(?m)^\\s*|\\s*$", "");
    }

    private  StringHelper();

}