This topic has been archived. It cannot be replied.
-
工作学习 / 学科技术讨论 / 请问如何用C#削掉多余的逗号.比如ABC,,,,,DEF,如何变成ABC,DEF.多谢!
-od2nw(cool);
2008-7-23
(#4574502@0)
-
split then join, when split, set the second arg to remove null value. post ur code after done, i want to know how. thanks
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574510@0)
-
string.Join(",", inputString.Split(new char[]{','}, System.StringSplitOptions.RemoveEmptyEntries)); this works, dont know if regular expression is faster
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574532@0)
-
Replace(",,",",") until length is not changed.
-niu1986(只吃草的牛);
2008-7-23
(#4574514@0)
-
regular expression可以轻松搞定。
-mfcguy();
2008-7-23
(#4574522@0)
-
show me how, thanks
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574536@0)
-
Regex rg = new Regex(@"[\,]{2,}");
OutputTxt.Text = rg.Replace(InputTxt.Text, ",");
-mfcguy();
2008-7-23
(#4574553@0)
-
thanks, regular expression looks much clean
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574563@0)
-
whats the difference between u and downstair?
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574570@0)
-
i have no idea,not my majia.
-mfcguy();
2008-7-23
(#4574572@0)
-
i mean the code, not id, know little about regular expression, so could not figure out the diff
-c1xwy(洪兴罩俺去战斗);
2008-7-23
(#4574577@0)
-
no difference, just different expression but same meaning
-sowen(昂居居);
2008-7-23
(#4574593@0)
-
Regex reg = new Regex(",{2,}");
string strNew = reg.Replace(str, ",");
-deep_blue(BLUE);
2008-7-23
(#4574552@0)
-
Regex reg = new Regex(",+"); ---- I think this is more suitable to generate REG rule
-thunderbolt(孙悟空);
2008-7-23
(#4575148@0)
-
Although in this case ",+" and ",{2,}" will have same result, (because replacing "," to "," doesn’t affect anything), in other circumstances there is difference. ",+" matches ",", ",,", or more. ",{2,}" matches ",,", or more.
-deep_blue(BLUE);
2008-7-24
(#4575805@0)
-
然
-thunderbolt(孙悟空);
2008-7-24
(#4577727@0)
-
多谢诸位.看来真是piece of cake.
-od2nw(cool);
2008-7-23
(#4574596@0)
-
再多问一句,在TRANSACT SQL 里,是否也有相应的办法?再谢!
-od2nw(cool);
2008-7-23
(#4574651@0)
-
Good news and bad news
-deep_blue(BLUE);
2008-7-23
{531}
(#4575046@0)
-
很有价值,多谢!
-od2nw(cool);
2008-7-23
(#4575520@0)