Split text with new line

“Name: Chase ***\nMail ID: ***@unitedfi\nPhone number: N/A\nJob title: Product Owner\n\nAlternative contact information:\nName: *** Randall\nMail ID: ***@unitedfiregroup.com\nPhone number: N/A\nJob title: N/A\n\nName: *** Pady\nMail ID: ***@unitedfiregroup.com\nPhone number: N/A\nJob title: N/A”

I have the above text as an output from chatgpt capi response and wish to split for every new line (\n) but all the methods fail like environment.newline or “/n” or vbCrLf.

what other solution do whave?

1 Like

System.text.ReularExpressions.RegEx.split(“Your string”, “\n”)

or you could try activity regex match by putting multi-line in the options.

Let me know.

Try with this expression in a assign activity

If you want as a array of value

arr_values = Split(str_input.ToString, “\n”)

If you want as a paragraph after removing \n

str_output =String.Join(Environment.NewLine, Split(str_input.ToString, “\n”))

Cheers @Karan_Zaveri


please try this

System.Text.RegularExpressions.Regex.Split("Your string", "\r?\n")