VL How to check for line break in String

NewLine doesn’t seem to work for every type of break.

true, the Newline constant is the windows default, which is CarriageReturn + LineFeed. we’re missing those two constants as individuals and something like we have in vvvv’s Separate (String) where there is an NewlineAutoDetection mode.

can you please show us your specific usecase? where/how did you expect to use Newline so that it failed for you?

My uscase is parsing an OBJ file, which has a different Newline type when exported by blender.
I worked around it, by getting the constant from the file with a “GetChars” and saved it in a pad.
Works for now. Thanks!

how about a node SplitToLines [String] that takes a string and returns a spread of strings. and the way it does the splitting is, it first tries to find any of the 3 possible lineendings (CR, LF, CRLF). as soon as it found one, it splits the whole file according to that. would that have helped?

That would be the perfect node for my usecase.

there is now a little surprise for you in latest alphas…

Very nice. Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.