0

Hi all,
I am trying to write a function which accepts a string as input and gives the integer as output,
The string can be in any of these format for ex:2,500.75 or 2.500,7501 or 2'500.7513 or 2500,254 the output of function should be like 2500.56

Basically trying to get rid of the thousand separator which can be either a comma,or apostrophe. ..

I request you experts to help me out at the earliest....
waiting for your replies ...thanks in advance....

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by ecrockers
0

Regular expression :

Dim regx = New System.Text.RegularExpressions.Regex("[,']")
Dim v1 = regx.Replace("2,500.75", "")
0

Regular expression :

Dim regx = New System.Text.RegularExpressions.Regex("[,']")
Dim v1 = regx.Replace("2,500.75", "")

Thank you for your reply..
This works fine if the data is in this format..2,500.78 and 2'500.78

but what if the data is in this format like 2'500,78 and 2,500'78 i mean the thousand separator are changed to these formats then it wont work!!!!!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.