Help exploding notes

Thanks, Mark! Now it’s obvious…

1 Like

How does one use trim to get rid of the undesired return? Thanks.

The String.trim([filterStr]) doesn’t support this. But using the test doc above:

I don’t get trailing line returns in Exploded titles (using v9.7.2), i.e. I can’t reproduce this problem. This thread is over 2.5 years old and I suspect the Explode function has been improved since (possibly in changes in b538 from late July '21).

If you are seeing this problem, it would be helpful to post a small test diagram so we can replicate it. we will also need your the Explode settings (a screen grab would be fine) as those settings aren’t saved in the document

Not to worry. I solved the issue using .replace \n …

$Text = $Text.replace("\n","-");

I wanted hyphens where the line breaks were. Thank you!

2 Likes

Note that if you’d like sequences of multiple line breaks replaced with a single hyphen be aware of the regex + operator which matches (at least) one or more successive instances of the preceding character (e.g. \n for a line break). Applied to your code it would be:

$Text = $Text.replace("\n+","-");

Thus this $Text:

"Thing.\nThing 1.\n\nThing2.\n\n\nThing 3."

using the above action would return:

"Thing.-Thing 1.-Thing2.-Thing 3."

By comparison your original code would give:

"Thing.-Thing 1.--Thing2.---Thing 3."

… of course might be axactly what you wnat. But now you have an option either way.

HTH

1 Like

Yes it does. Thank you :blush: