Java String Unescape unEscapeString(String str)

Here you can find the source of unEscapeString(String str)

Description

un Escape String

License

Apache License

Declaration

private static char unEscapeString(String str) 

Method Source Code

//package com.java2s;
/*//from  w w  w.j  a  v  a 2s .c  o  m
   Copyright 2013, 2016 Nationale-Nederlanden
    
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at
    
   http://www.apache.org/licenses/LICENSE-2.0
    
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/

public class Main {
    private static char unEscapeString(String str) {
        if (str.equalsIgnoreCase("<"))
            return '<';
        else if (str.equalsIgnoreCase("&gt;"))
            return '>';
        else if (str.equalsIgnoreCase("&amp;"))
            return '&';
        else if (str.equalsIgnoreCase("&quot;"))
            return '\"';
        else if (str.equalsIgnoreCase("&apos;") || str.equalsIgnoreCase("&#39;"))
            return '\'';
        else
            return 0x0;
    }
}

Related

  1. unescapeString(String s)
  2. unescapeString(String s)
  3. unescapeString(String s)
  4. unescapeString(String s, char enclosed)
  5. unEscapeString(String str)
  6. unescapeString(String str)
  7. unEscapeString(String str)
  8. unescapeString(String string)
  9. unescapeString(String string, String escapeChars, char escapeSymbol)