Class UnicodeUtilities


  • public class UnicodeUtilities
    extends java.lang.Object
    Author:
    Simon Thoresen Hult
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String generateToken​(UnicodeUtilities.Predicate predicate)  
      static java.lang.String quote​(java.lang.String str, char quote)
      Adds a leading and trailing double quotation mark to the given string.
      static java.lang.String unquote​(java.lang.String str)
      Removes leading and trailing quotation mark from the given string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UnicodeUtilities

        public UnicodeUtilities()
    • Method Detail

      • quote

        public static java.lang.String quote​(java.lang.String str,
                                             char quote)
        Adds a leading and trailing double quotation mark to the given string. This will escape whatever content is within the string literal.
        Parameters:
        str - The string to quote.
        quote - The quote character.
        Returns:
        The quoted string.
      • unquote

        public static java.lang.String unquote​(java.lang.String str)
        Removes leading and trailing quotation mark from the given string. This method will properly unescape whatever content is withing the string literal as well.
        Parameters:
        str - The string to unquote.
        Returns:
        The unquoted string.