View previous topic :: View next topic
|
Author |
Message |
MadanVS
New User
Joined: 28 Dec 2010 Posts: 25 Location: Chennai
|
|
|
|
I want to remove lead xx alone in my string. I am facing incorrect call to routine error when i try to execute this code:
Code: |
SAY
SAY
SAY
LCF = 'XX'
M = "XXXMADAN"
SAY " M : " M
NAME=STRIP(M,,LCF)
SAY "NAME : " NAME
|
i am getting MADHAN in output.
I want XMADAN in my output. Can any one throw some light on this?
thanks
Madan |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Can any one throw some light on this? |
why not take a closer look at the manual
seems to me that Your understanding of how STRIP works is a bit foggy
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4A370/4.3.55?SHELF=IKJ4BK90&DT=20060626210253
( both from a logic and coding points of view )
anyway what You want to do cannot be achieved using STRIP
Code: |
data = "notxxsomething"
data = "xxsomething"
data = "xx"
tokn = "xx"
if left(data,length(tokn)) = tokn then ,
data = substr(data,length(tokn)+1)
say data
|
|
|
Back to top |
|
|
MadanVS
New User
Joined: 28 Dec 2010 Posts: 25 Location: Chennai
|
|
|
|
Thanks enrico
Its working |
|
Back to top |
|
|
|