How to remove hyphens from a string [message #238376] |
Thu, 17 May 2007 14:08 |
srajan72
Messages: 20 Registered: February 2006
|
Junior Member |
|
|
How do I reformat a string to remove all instances of '-' (hypen)?
Example: 'ABC-DE-FGHI' should translate to 'ABCDEFGHI'.
I cannot use SUBSTR because the source string can be in different formats.
I'd appreciate any help.
|
|
|
|
|
Re: How to remove hyphens from a string [message #238381 is a reply to message #238376] |
Thu, 17 May 2007 14:28 |
srajan72
Messages: 20 Registered: February 2006
|
Junior Member |
|
|
Thanks for your replies.
I tried TRANSLATE, but since I needed to replace '-' with nothing, I tried using NULL (e.g., TRANSLATE(str1,'-',NULL) with obvious undesired result.
I'd really appreciate if you can tell me how I can use TRANSLATE here.
By the way - REPLACE works when I tried REPLACE(str1,'-',NULL)
Thanks once again for your help.
[Updated on: Thu, 17 May 2007 14:29] Report message to a moderator
|
|
|
|
|