Extract part of one String

Hi Guys …

I have a string like this …

image

I just need the string between the tags, I am not sure if that tags will be always the same long so maybe I could do a substring …

Is any way to do it? The tag has a variable name always … the long seems to be the same …but not sure if always will be like that.

Hi @carmen

You can use the Match Activity https://docs.uipath.com/activities/docs/matches

In the pattern you can include the predefined tag that you have, you only need to add and .* to match all the characters after the tag.

Regards,

Andres

@AndresTarazona I don’t think we can see your String :sweat_smile:, If it contains HTML tags Take a Screenshot of it and Send

oh good point … I didnt notice xD

1 Like

@Carmen - you can try with String.SubString option -
Am assuming only one div will be available in the string strOut - below logic will return your expected value.

strOut.Substring(strOut.IndexOf(“>”)+1,strOut.IndexOf(“”)-strOut.IndexOf(“>”)-1).Trim

@carmen Check this Link :

Try your other Sample Strings in it, If it gives the Output that you need, Then you can use Matches Activity and Retrieve all the Matched Strings

thanks, I was trying but that is not working …

that works perfect. Thanks

1 Like

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