Removing the extra dots from the string

var = 23.85.655.00
I want output as 2385655.00
Numbers can be in any format like 1.25.698.00 or 78.52.25.899.00. I want the last dot to be present and rest removed.

@Asfaque

Welcome back to our UiPath community.

Is input string always ends with .00 ?

If yes then try below expression.

var.SubString(0,var.LastIndexOf(".")-1).Replace(".","")+".00"

1 Like

Hi @Asfaque ,

Check the Below Steps :

  1. Let inputStr be the input String variable. Assign the Input value.
inputStr = "23.85.655.00"
  1. Next, we can Keep only the Last . with the Below Expression :
Strings.Replace(inputStr,".","",1,inputStr.Count(Function(x)x=".")-1)
1 Like

THANKS! It worked

1 Like

Hi Lakshman, It should not necessarily ends with .00 it can be any number 2-digit or 3-digit.

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