string str = "4231"; int js = 1; var ss = ""; for (int i=0;i<str.Length;i++) { var s0 = str[i].ToString(); var s1 = (js).ToString(); if (s0==s1) //把1查找出来 { ss += str[i].ToString(); js++;
//移除该元素 i = -1;
} }