next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > strings and nets > separate

separate -- split a string into pieces

Description

separate(d,s) -- split the string s into pieces delimited by the string d.

The value is a list of the pieces, the number of which is one more than the number of occurrences of d in s, so that the pieces may be reassembled with between.

i1 : separate( ".", "a.b.c.d" )

o1 = {a, b, c, d}

o1 : List
i2 : peek separate( ".", "a.b.c.d" )

o2 = {"a", "b", "c", "d"}
i3 : demark("=",ooo)

o3 = a=b=c=d

Ways to use separate :