code: String prefix(String s, String pre, String post) {
          if (s == null) {
              return "";
          }
          String pp = s.replaceAll("\\R", post + pre);
          if (pp.endsWith(post + pre)) {
              // prevent an extra prefix char and blank line when the string
              // already terminates with newline
              pp = pp.substring(0, pp.length() - (post + pre).length());
          }
          return pre + pp + post;
      }
docs: Add prefixing/postfixing to embedded newlines in a string,
  bracketing with prefix/postfix
  
  @param s the string to prefix
  @param pre the string to prepend to each line
  @param post the string to append to each line (replacing newline)
  @return the pre/post-fixed and bracketed string