如何将字符串中的值从0,00更改为0.00? - 只有数字值,而不是所有字符","到"."
从
string myInputString = "\n\n";
|
12,0000 0,0000 0,0000 0,0000 0,0000 0,0000 0
至
string myInputString = "\n\n";
|
12.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0
感谢您的回答,但我的意思是只更改数值,而不是所有字符","更改为"." 我不希望改变字符串
string = "txt txt, txt 12,1223 ";
至
string = "txt txt. txt 12.1223 ";
但是这个还可以
string = "txt txt, txt 12.1223 ";
Canavar.. 5
试试这个 :
Regex.Replace("attrib1='12,34' attrib2='43,22'", "(\\d),(\\d)", "$1.$2")
输出: attrib1 = '12 .34'attrib2 = '43 .22'
试试这个 :
Regex.Replace("attrib1='12,34' attrib2='43,22'", "(\\d),(\\d)", "$1.$2")
输出: attrib1 = '12 .34'attrib2 = '43 .22'