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
Post a Comment