Get individual value from string

Hi Team,

I am getting attached result from regex expression.
Now I need to get single single values from that regex output.
For eg. 1) 0C0000712 2) AR 3) Cars Gruop PLC

How we get that
image

1 Like

can i have the text which you are applying the regex on

Hi @sshitol

Can you please share the regex code?

System.Text.RegularExpressions.Regex.Match(item.Body,"(?<=Doc Id)([\S\s]*)(?=Thanks )").Value.Trim

Above is the text. We are getting this data from mail (table format)

awesome if this in a string input variable named str_input
then the expression would be like this
str_value1 = str_input.Split(Environment.Newline.ToArray(),StringOptions.RemoveEmptyEntries)(0).ToString

str_value2 = str_input.Split(Environment.Newline.ToArray(),StringOptions.RemoveEmptyEntries)(2).ToString

str_value3 = str_input.Split(Environment.Newline.ToArray(),StringOptions.RemoveEmptyEntries)(3).ToString

Cheers @sshitol

@sshitol

Then it is very simple you just split the string with the new line. All the text will be stored in an array.

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