Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUBSTR with Delimiter

Status
Not open for further replies.

christiniaroelin

Programmer
Sep 15, 2004
26
US
Hi group,

Im pretty new to rexx-coding. I'm trying to substr 'JKLMN' from abc.def.ghi.JKLMN

Is there a way to substr using "." as a delimiter??
Please advice on the above. I could achieve the above by providing hardcoded position as values for SUBSTR function, which may not be the case in reality.

Thanks much!
Christinia
 
You will probably do better with 'parse':
Code:
str = "abc.def.ghi.JKLMN"
parse var string word1 "." word2 "." word3 "." word4 .
say word4
>>> 'JKLMN'
say word1 word3 word2
>>> 'abc ghi def'

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
I would like to add an additional note to this.

An invaluable book - to every REXX programmer, beginner or experienced I believe is the 'first' book on REXX, written by the man himself - IBM Fellow, Mike Cowlishaw - titled - 'THE REXX LANGUAGE' A Pratical Approach to Programming, published by Prentice-Hall - 1985.

I have had this book since 1987. (It is showing some wear and tear :) and I still refer to it.

There have been additional follow-up books, like the REXX-HANDBOOK (JRande Series etc.) but this book to me is the 'bible'

So if you are, or want to get into REXX, it is worth the small investment to order it.

zSoftware
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top