comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » splitting strings
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
splitting strings [message #42448] Thu, 03 February 2005 12:29
Benjamin Hornberger is currently offline  Benjamin Hornberger
Messages: 258
Registered: March 2004
Senior Member
Hi all,

I would like to split a string by whitespace characters, while anything
between quotes should be recognized as one elements (even if it contains
whitespace). Let's say I have the string

'cat dog "ground hog" bird'

I want to split it into ['cat', 'dog', 'ground hog', 'bird']. Does
anybody have a general algorithm or a function to do that? Or do I have
to work it out myself?

I guess this must be a very standard problem for config file parsers in
any programming language...

Thanks for your help,

Benjamin
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: How do I force standard output?
Next Topic: Re: Creating an image as a sum of images

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:43:02 PDT 2025

Total time taken to generate the page: 0.00596 seconds