www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - tango.text.util delimit

reply "seany" <seany uni-bonn.de> writes:
The delimit function in tango, called by auto w = 
delimit(complex_str, del_chars), uses each char in the string 
del_chars as a delimiting character to split complex_str.

however, i need to parse a bit of latex, and would love to know, 
if it is possbile to parse a string, whose "components" are 
delimited by another string.

eg:

a && b && c && d\\ e && f && f && g\\

this string has the components ... a ...g and they are delimited 
by \\ or && (two char long strings)

does tango provide a function for that?

sorry if i missed the answer where i should have looked
Jun 13 2013
parent reply Jacob Carlborg <doob me.com> writes:
On 2013-06-13 15:46, seany wrote:
 The delimit function in tango, called by auto w = delimit(complex_str,
 del_chars), uses each char in the string del_chars as a delimiting
 character to split complex_str.

 however, i need to parse a bit of latex, and would love to know, if it
 is possbile to parse a string, whose "components" are delimited by
 another string.

 eg:

 a && b && c && d\\ e && f && f && g\\

 this string has the components ... a ...g and they are delimited by \\
 or && (two char long strings)

 does tango provide a function for that?

 sorry if i missed the answer where i should have looked
Is tango.text.Util.split what you are looking for? http://www.dsource.org/projects/tango/docs/current/tango.text.Util.html#split -- /Jacob Carlborg
Jun 13 2013
parent "seany" <seany uni-bonn.de> writes:
On Thursday, 13 June 2013 at 13:53:33 UTC, Jacob Carlborg wrote:

 Is tango.text.Util.split what you are looking for?

 http://www.dsource.org/projects/tango/docs/current/tango.text.Util.html#split
thanks, my day is made, packaged, and delivered :)
Jun 13 2013