From the original SynthMaker forum (2004–2014), with its members’ names and dates.
mwvdlee ·
Based on this discussion: *FIXED* Comma's in string arrays
What I request is a new primitive that takes as two Strings "Text" and "Delimiter" as input and outputs a String Array.
If Text is a zero-length string, output contains nothing.
If a zero-length string is given for Delimiter, the output contains one line, containing the entire unchanged content of Text.
Else (and the most likely usage scenario) if Delimiter is a non-zero-length string, the output may contain multiple lines where each line is part of the input, delimited by the string specified in Delimiter. The Delimiter string itself is not in the output.
Alternatively, a primitive that does not take a Delimiter string but splits line at Newline would also be fine, although a user-specified delimiter would be more flexible and likely allow other common operations to benefit from increased performance.
The reason for this request is that the automatic conversion of String datatype to String Array datatype delimits the lines by both newlines and the comma (',') character. Depending on the situation, linebreaking on either character may be unwanted.
rl ·
vote++
sunsynth ·
yup, i'm on board 2++
trogluddite ·
And Another+
TomC ·
Just do make this clear: the delimiter should be a String, that means a delimiter could be longer than one single character.
Of course another ++
Tom
aliasant ·
+1
exonerate ·
Such a primitive is definitely needed. 🙂
infuzion ·
+1 delimit by only user-defined character, not by whitespace primitive
mwvdlee ·
infuzion wrote: +1 delimit by only user-defined character, not by whitespace primitive
I thought the NL primitive matched only NL (0x0A) and was essentially similar to a string constant?
oddson ·
mwvdlee wrote:
infuzion wrote: +1 delimit by only user-defined character, not by whitespace primitive
I thought the NL primitive matched only NL (0x0A) and was essentially similar to a string constant?
Me too... AFAIK it's only there because you can't type return into a String primitive (although you can in the text).
Wrote something here? To have a post removed or your name hidden, write to [email protected].