Remove special characters from a string [message #115687] |
Wed, 13 April 2005 11:40  |
sudhakarp
Messages: 2 Registered: April 2005 Location: UK
|
Junior Member |
|
|
Hi,
I have requirement in which I need to compare two strings.
Special characters in the string should be ignored in the comparison.
Special characters are: = + ( ) “ ” ! # . , - _ : ; / \ * ^ % £ $ ? [ ] < > @ & { }
Please advice.
Thanks in advance
Sudhakar
|
|
|
|
Re: Remove special characters from a string [message #116096 is a reply to message #115687] |
Sun, 17 April 2005 12:12  |
tvssbjagdish
Messages: 32 Registered: March 2005 Location: Hyderabad
|
Member |

|
|
That goes here..
When u have the data like
col1
---------
abc 123
abc123
abc@#123
abc*(&)123
U can eliminate them by translate function
Select translate(upper(trim(col1)),'1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ ~!@#$%^&*()_+}{":?><`-=]['''';/.,','1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ') from mytable;
The output will be
ABC123
ABC123
ABC123
ABC123
Hope this helps
Jagdish
|
|
|