escape static method

String escape(
  1. String input
)

Escapa os 5 caracteres reservados de XML.

Implementation

static String escape(String input) => input
    .replaceAll('&', '&')
    .replaceAll('<', '&lt;')
    .replaceAll('>', '&gt;')
    .replaceAll('"', '&quot;')
    .replaceAll("'", '&apos;');