Cut String

Hello, I have a question that I am not able to solve. I have a string ("3214521-Factura.pdf) for example, I would like to first cut the string (remove ".pdf “) and then separate the numbers from the word after the script (on the one hand” 3214521 "and on the other hand “Invoice”) Is it possible to do this?

To cut strings I’ve seen “split” out there but I’m not able to use it in UiPath.

Thank you very much.

Hi,

Please find below screenshots showing Split String activity.

Capture1Capture2

Regards,
Rahamat

Hi there @fpradas
You can do the following:

Assign - strMyString = "3214521-Factura.pdf"
Assign - arrMyStrings = strMyString.Split(Char.Parse("."))
Assign - strNumbers = arrMyString(0).Split(Char.Parse("-"))(0)
Assign - strText = arrMyString(0).Split(Char.Parse("-"))(1)

Your required outputs will be:

  • strNumbers (“3214521”)
  • strText (“Factura”)

Thanks,
Josh

2 Likes

Ok, thanks.
I do not have that activity. What package of activities have you installed?

Hi there @fpradas,
Did you get it working with the activities noted by @rahamtullah?

Thanks,
Josh

yes!!

1 Like

Good Job