How to get rid of new line (\n)?

I need to read some information so i use storetext but the text is in the format “name\nage”
And the value i get is
“Mike
54”
But i dont need the age only the name so i need a way to get rid of the “\n” character and read only the text before it, i tried the examples here:

and here:

but doesnt work, maybe my syntax is not accurate.

Some help please?

thank you

{
  "Name": "TEST",
  "CreationDate": "2022-3-9",
  "Commands": [
    {
      "Command": "store",
      "Target": "Mike\\n54",
      "Value": "TEST",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${TEST}",
      "Value": "red",
      "Description": ""
    },
    {
      "Command": "executeScript_Sandbox",
      "Target": "return ${TEST}.split('\\n')[0];",
      "Value": "TEST",
      "Description": ""
    },
    {
      "Command": "echo",
      "Target": "${TEST}",
      "Value": "green",
      "Description": ""
    }
  ]
}

2 Likes

Thank you very much Sir, works perfect.