Use Regex

How to get all the text after the particular word?

2 Likes

@Mani_Mani Please check below regex.

var = “Employer: Ram
Age: 56”

If you want value just after “Employer” Keyword i.e “Ram” which is same line. Use below regex expression.

Output-- Ram

 System.Text.RegularExpressions.Regex.Match(var,"(?<=Employer:).+").ToString 

If you required output which might be distributed in multiple lines then use below regex.

output-- Ram
Age: 56

System.Text.RegularExpressions.Regex.Match(var,"(?<=Employer:).+",RegexOptions.Singleline).ToString
2 Likes

Very simple buddy
if the input string is like this
in_str = "My name is Mani from India"

and if you want all the text after is from the above string
then one steps at a time
out_str = in_str.Split(“is”)(1).ToString.Trim
where the output would be
out_str = "Mani from India"
and (1) denotes the index position
where
(0) = My name
separator = is
(1) = Mani from India

Thats all buddy you are done
for more insights on split method

Kindly try this and let know for any queries or clarification
Cheers @Mani_Mani

1 Like