Java String Sanitize sanitizeJavascript(String originalString)

Here you can find the source of sanitizeJavascript(String originalString)

Description

sanitize Javascript

License

Open Source License

Declaration

public static String sanitizeJavascript(String originalString) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String sanitizeJavascript(String originalString) {
        return originalString.replaceAll("[\\\\(\"\')\\]\\[]", "\\\\$0");
    }//w  ww .ja  v a  2 s .  c  o m
}

Related

  1. sanitizeIdentifier(String identifier)
  2. sanitizeIdentifierName(String input)
  3. sanitizeIDs(String str)
  4. sanitizeInput(String input)
  5. sanitizeInput(String string)
  6. sanitizeLine(String line)
  7. sanitizeLineSpaces(String line)
  8. sanitizeLoggerNamePart(String name)
  9. sanitizeMethodName(String methodName)