IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

replacing characters in a string.....


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
foliater

New User


Joined: 06 Apr 2006
Posts: 31

PostPosted: Mon May 29, 2006 7:40 pm
Reply with quote

let us assume we have

x = 'fivestar'

i need to replace 'star' in 'fivestar' by 'sun'

can anyone help me regarding this....
Back to top
View user's profile Send private message
unicorn

New User


Joined: 29 May 2006
Posts: 3

PostPosted: Tue May 30, 2006 11:08 am
Reply with quote

The following code should help you....

/*=============REXX============== */
a = 'star'
b = 'sun'
x = 'fivestar'
p = pos(a,x)
x = delstr(x,p,length(a))
x = insert(b,x,p-1,length(b))
say x
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Replacing FILLER with FILLER<SeqNu... DFSORT/ICETOOL 2
No new posts ICETOOL to SUM String DFSORT/ICETOOL 1
No new posts Mark Previous & next lines when a... DFSORT/ICETOOL 9
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
No new posts Help with C character vs C string All Other Mainframe Topics 3
Search our Forums:

Back to Top