Slice string item output

Hello everyone, i’ve this input


my goal is to slice or trim the string.
But not random, i would like to take only the word or sentence betwen \n, in this case “test” and the other deleted.
can be a sentence or word, every time is different
thanks

Update:
so far i’ve used the code node with the javascript .replace but i can delete only the first part

Hey @Gabriele_Bracciali,

Have you tried using split('\n') that would then split the string into an array and each item is split on the \n, The workflow below shows it in action.

1 Like

Hey @Jon , thanks for replying.
Oh yes that’s what i need, so i don’t need to use a code node for run little javascript function(?), i can do it in the Set node

Hey @Gabriele_Bracciali,

You got it, So you can do it with a Code node as well but sometimes depending on what you are doing a Set node or anywhere that lets you input an expression is just as good.

1 Like

okay nice, that’s good to hear, i didn’t know before.
Thanks for your help like always!
pace

1 Like

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