字符串替换问题 (在线等)
我写了一段代码,要删除字符串例如 ####1234#123 前面开头所有的#
我写的代码只能替换开头的2-3个 # 还剩下两个, 另我非常不理解。
下面代码输出结果 ##123#123 为什么前面还剩2个。。。
string local = "#####123#123"; int i = 0; while(local.Substring(i,1)=="#") { local = local.Remove(i, 1); i++; } MessageBox.Show(local + "---" + i);