parse a string using a delimeter in xml
Posted on 2011-04-27
I'm a newbie to web programming and I'm sure glad I found this site.
I have a string which I want to parse into 4 segments using a dash "-" as a delimeter. Here is a sample data element: ItemUpdate-HOSP-99998-C. My data is contained in an xml string: <!qry_wfw_WORK_TITLE>. I know how to parse the xml string using a substring function; example <!qry_wfw_WORK_TITLE.substr(16, 5)> returns "99998". How would I split the data into 4 different fields using a dash as a delimeter? In other tools I would use a split function such as lsplt([field name], 4, "-", 3) where the function uses the delimeter "-" and returns the 3rd segment.