escape static method

String escape(
  1. String input
)

Escape HTML special characters

Implementation

static String escape(String input) {
  return input
      .replaceAll('&', '&')
      .replaceAll('<', '&lt;')
      .replaceAll('>', '&gt;')
      .replaceAll('"', '&quot;')
      .replaceAll("'", '&#x27;');
}