![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: parsing a comma seperated string Topic Summary: parsing a comma seperated string Created On: 6-Feb-2007 09:06 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
My string could be of variable length but will take the form
text, text1, text2, text3,text4 etc etc I want to extract the substrings text text1 text2 into individual array members not sure how to acheive this thanks for any guidance. |
|
![]() |
|
![]() |
|
Hi Martin,
you could use a Regular Expression to do your task: Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany |
|
![]() |
|
![]() |
|
Thank you Reik that is exactly what I want, is there a way to trim off any empty spaces at the beguinning or end of each of the substrings once I have them?
|
|
![]() |
|
![]() |
|
Hi Martin,
you could change the Regular Expression like this: Regexp commaRE = regexp "(^|,)[ \t\n]*([^, \t\n]+)[ \t\n]*($|,)" Greetings Reik ------------------------- Evosoft GmbH for Siemens Industry Sector Berlin, Germany Edited: 6-Feb-2007 at 10:53 by Reik Schroeder |
|
![]() |
|
![]() |
|
Thanks ever so much Reik
|
|
![]() |
Telelogic DOORS
» DXL Exchange
»
parsing a comma seperated string
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.