Need to modify the string

Hi All,

I need to modify the value from (17,039.66) to 1703966
please help to convert the above value to 1703966

Hello @shruthi_arali , Try replace method

YourStr=17,039.66

YourStr.Replace(",","").Replace(".","")


If data with bracket

YourStr=(17,039.66)
YourStr.Replace(",","").Replace(".","").Replace("(","").Replace(")","")

Also Try Regex replace method

System.Text.RegularExpressions.Regex.Replace(YourStr,"\W","")

1 Like

HI @shruthi_arali

str_Variable=System.Text.RegularExpressions.Regex.Replace(“(17,039.66)”,“[(),.]”,“”)

You can try with regex also
image

2 Likes

Hello @shruthi_arali

  1. Take “Assign” activity.
  2. In the “To” field of the “Assign” activity, create a variable to store the converted value. Let’s call it “convertedValue” and set its data type to Integer.
  3. In the “Value” field of the “Assign” activity,
  • OriginalValue As String = “17,039.66”
  • ConvertedValue As Integer = Integer.Parse(originalValue.Replace(“,”, “”).Replace(“.”, “”))

Thanks & Cheers!!!

2 Likes

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