c# - How to remove more than one dot (.) from text? -


how remove more 1 dot (.) text ?

for example:

123..45  = 123.45 10.20.30 = 10.2030 12.34    = 12.34 12..     = 12 123...45 = 123.45 

how ?

thanks in advance

it not necessary use regex, can achieve need in way:

 string s = "10.20.30";         int n;         if( (n=s.indexof('.')) != -1 )             s = string.concat(s.substring(0,n+1),s.substring(n+1).replace(".","")); 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -