Delete part of a character string

Hello friends, I have obtained a text string with the activity ‘UiPath.UIAutomationNext.Activities.NGetText’ my string is “1 - 13” and I want to save the last two characters of the string, in this case 13, in another variable. Then with the activity ‘UiPath.Core.Activities.TypeInto’ I want to write "now.AddDays(2).ToString(“ddMMyy”) + “LAC013"” → 260822LAC013
How can I save the last two characters of my string and then add them to 'now.AddDays(2).ToString(“ddMMyy”) + “LAC0” + “Variable” ’ ?

Hi @achap

You can try with Split

Split("1 - 13".Trim,"-")(1)

image

Expression is

now.AddDays(2).ToString(“ddMMyy”) + “LAC0”+Split("1 - 13".Trim,"-")(1)

Regards
Gokul

Hi @achap ,

You could use the Substring method like below :

str = "1 - 13"

lastTwoChar = str.SubString(str.Length-2)

You could then use the variable to append with your value :

now.AddDays(2).ToString("ddMMyy") + "LAC0" + lastTwoChar

Output @achap

image

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