Cut String

studio
string

#1

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.


How do i split the name from the get text activity?
#2

Hi,

Please find below screenshots showing Split String activity.

Capture1Capture2

Regards,
Rahamat


#3

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


#4

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


#5

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

Thanks,
Josh


#6

yes!!


#7

Good Job