cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove all special characters

Former Member
0 Kudos

Hi,

I want to remove all (128-223)the special characters that come in the mapping from the URL

http://www.danshort.com/ASCIImap/

128-223 ,I mean if any characters that come in between these numbered characters I have to remove in mapping.

please suggest.

thank you,

Sri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

try a better way to get.. but here for temp solution


public static String removeSpecial(String text) {
    int length = text.length();
    StringBuffer buffer = new StringBuffer( );
    for(int i = 0; i < length; i++) {
        int ch = ( int ) text.charAt(i);
        if (  ( ch < 128)) {
            buffer.append( ( char ) ch );
        }
    }
    return buffer.toString();
}

Edited by: Anand on Nov 25, 2008 10:23 PM

Former Member
0 Kudos

also use this blog along with the above code...

https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]

Former Member
0 Kudos

thank you Anand.

works perfect.that blog,we have to have JAVa mapping,but this UDF is good simple.

thank you for your help.

Sri

Answers (1)

Answers (1)

Former Member
0 Kudos

HI Sri

You can use the Java code as given above

Other method can be XSLT

  <xsl:stylesheet  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> 
            <xsl:output  method="xml" indent="yes" omit-xml-declaration="yes"/> 
            <xsl:template  match="/source node"> 
                  <target node> 
                        <xsl:value-of  select="replace(.,'sepcial character','')"/> 
                  </target node> 
            </xsl:template> 
      </xsl:stylesheet>

Thanks

Gaurav