Java String Quote quoteAttrValue(String s)

Here you can find the source of quoteAttrValue(String s)

Description

Perform entity-quoting of quotes within attribute values.

License

Open Source License

Declaration

public static String quoteAttrValue(String s) 

Method Source Code

//package com.java2s;

public class Main {
    /** Perform entity-quoting of quotes within attribute values. */
    public static String quoteAttrValue(String s) {
        return "\"" + s.replaceAll("&", "&").replaceAll("\"", """).replaceAll("\'", "'") + "\"";
    }/*from  w  ww  . java 2 s . c  om*/
}

Related

  1. quoteArgForCommand(String input)
  2. quoteArgument(final String argument)
  3. quoteArgument(String arg)
  4. quoteAtom(String term)
  5. quoteAtom(String term)
  6. quoteCanonical(String s)
  7. quoteCeylonKeywords(String qualifiedName)
  8. quoteCharacterData(char[] ch, int start, int length)
  9. quoteCharacterData(String s)