How to get only numbers from this sentence

i received a mail .subject .contains (id-45616556).now i need to get only numbers from the subject
mail.subject.contains(id-4565546).then i need only numbers from this subject in message box.
what is the expression i have to enter…please suggest

Hi @gowrishankar_allada

You Can try with Split method!

Item.Subject.Split("-"c)(1) will give numbers only!


1 Like

Hi @gowrishankar_allada ,

Please use split method to get only numbers



1 Like


Welcome to forums

You can use Regex for this

UiPath Screenshot as below


Regex : system.Text.RegularExpressions.Regex.Match(Subject,"\d+").Value

Hope this may help you


1 Like

tq so much

1 Like

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