Issue with Splitting String

i have two lines, for example this is how it looks in messaqe box
Credit $0.00 USD
Grand Total $40.00 USD

i want only “$40.00” to be displayed, any idea what’s the proper way to use split hereCapture

How you got this two values
(Credit $0.00 USD
Grand Total $40.00 USD)?
Try scrap relative in citrix. Or You can use String functions like Spit or replace etc.

@bbarik1994

If you get these value in 2 variable then

Use : (Variable2.split("$“c).Last).replace(“USD”,”")

You can use either Regex or string manipulations to extract the required value from the string.

One simple way is -
Considering your string is in the below format -

str = “Credit $0.00 USD \nGrand Total $40.00 USD”;
str.Substring(str.IndexOf(“Total”)+6).Replace(" USD","")

If it is an array, load the second line into a str and use the same code.

1 Like