Remove hyphens in a string variable - solution - thanks reply

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Remove hyphens in a string variable - solution - thanks reply

thara vardhan-2
Dear List Members

In response to my question on how to remove hyphens in a string variable
Andrew Fenyo was very kind to send me the following syntax.
It works perfectly.

Thank you so much Andrew for helping me solve the problem.

thanks
regards
Thara Vardhan
Senior Statistician
Performance Improvement & Planning



Hi Thara,

Assuming your original variable is "input", uou could use the following:

STRING OUTPUT(A??).
COMP
output=CONCAT(RTRIM(SUBSTR(input,1,INDEX(input,"-")-1)),RTRIM(SUBSTR(input,INDEX(input,"-")+1,LEN(input)))).

bw

Andrew
(22 years in Sydney, to 1970!)

--
Andrew J Fenyo
Senior Computing Officer
Personal Social Services Research Unit
George Allen Wing, Cornwallis Building
University of Kent, Canterbury CT2 7NF
UK

Tel: 01227 827610
Fax: 01227 827038
Mob: 07767 761338

URL: http://www.pssru.ac.uk













_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

The information contained in this email is intended for the named recipient(s)
only. It may contain private, confidential, copyright or legally privileged
information.  If you are not the intended recipient or you have received this
email by mistake, please reply to the author and delete this email immediately.
You must not copy, print, forward or distribute this email, nor place reliance
on its contents. This email and any attachment have been virus scanned. However,
you are requested to conduct a virus scan as well.  No liability is accepted
for any loss or damage resulting from a computer virus, or resulting from a delay
or defect in transmission of this email or any attached file. This email does not
constitute a representation by the NSW Police Force unless the author is legally
entitled to do so.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD