escapeString static method

String escapeString(
  1. String str
)

Takes a string and returns the escaped string for that character. @param {string} str The string to escape. @return {string} An escaped string representing {@code str}.

Implementation

static String escapeString(String str)
{
  StringBuffer sb = new StringBuffer();
  for (int i = 0; i < str.length; i++)
  {
    sb.write( escapeChar( str.codeUnitAt(i) ) );
  }
  return sb.toString();
}