How to get particular word from the string

C

I want to get Tax INVOICE from the message box…What should i do

Hi @Madhukumar_M use split string activity or
string.split method.

Thanks,
Kalyan.

@Madhukumar_M

Please use assign activity

Str1array =Str.Split(Environment.NewLine.ToCharArray)

Regards,
Mohanraj.S

@Madhukumar_M,

You want to get the random value in the second line right?
try this : text is the entire string you have

text.Substring(text.IndexOf("Invoice ")+"Invoice ".Length).Split(Environment.NewLine.ToCharArray)(0)

@Madhukumar_M

str=“TAX INVOICE
07AABCC7181N1ZA
ROOM NO 24, LEVEL 4”

If you want “07AABCC7181N1ZA” as output try like below.

str.Split({Enviornment.Newline},StringSplitOptions.RemoveEmptyEntries)(1).Trim

For these situation it is always good to use and practice Regex since it is very useful to know how to manipulate strings in that way.
You can use Match activity, or you can use them in a Assign activity.

Example.xaml (4.6 KB)

Here is an example of how to use Regex and Matches Activity for your case