How to Split the string after '-'

Hello Guys,

i want to split this string ‘UWP300-2100259’. I only want value after ‘-’, if we consider the following string. I only want value 2100259.

Can you guys help me with regular expression.

Thanks in advance.

Regards,

Rahul Jawahirani

Hi @Rahul_Jawahirani ,

You can use Name.Split(CChar("-")) where Name=UWP300-2100259 and store it in SpilText where SplitText is a string of array type variable.

Now use SpiltText(1).tostring in a write line activity and you will have your desired output.

Best,
Robin

@Rahul_Jawahirani , missed the part where you asked for regular expression.

-\w* this one might help you. This will extract -2100259 from the text. After that you can replace the ‘-’ as “”.

Hope that helps.

Thank alot for your quick response… I was looking for Regular expression itself.

Your idea works. Thanks.

Regards,

Rahul Jawahirani

1 Like

@Rahul_Jawahirani , My pleasure.

Happy Automation! :slightly_smiling_face:

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