Delimiter Issue

Hi All,

I have an input variable type String - (InputString) value as mentioned below

“XXX-XX-1234 CHIRU K STAR
XXX-XX-4567 PAWAN K KALYAN
XXX-XX-6789 RAM K CHARAN
XXX-XX-1212 SAI D TEJ”

I have two more variables

  1. strDelimiter - variable type string and value - “\r\n”
  2. FinalOutput - variable type is array of string - System.String

My expression is
FinalOutput = System.Text.RegularExpressions.Regex.Split(InputString, strDelimeter)

I need the output as

FinalOutput as
{
“ XXX-XX-1234 CHIRU K STAR”,
“XXX-XX-4567 PAWAN K KALYAN”,
“XXX-XX-6789 RAM K CHARAN”,
“XXX-XX-1212 SAI D TEJ”
}

Note : The input might have 1 to many lines

My input delimiter is not working.

Please let me know if you don’t understand the question.

TIA

Hi @Ragala

In strDelimiter variable try the below one

"[\r\n]"

FLOW:

XAML:
Sequence26.xaml (8.9 KB)

Output:
image

Regards

Use VbCrLf (no quotes, it’s a constant) instead of “\r\n”

Also, there’s no reason to use Regex, and no reason to create a variable for the delimiter. Just put the delimiter into the expression:

Split(InputString,VbCrLf)

And if you want to use it in a For Each, you don’t have to assign it to a variable. Just put the Split expression directly into the For Each.

Thanks @vrdabberu and @postwick for your great efforts.

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