public string StrReplace(string stri,int asc)
    {
        string temp="";
        CharEnumerator CEnumerator = stri.GetEnumerator();

        while (CEnumerator.MoveNext())
        {

            byte[] array = new byte[1];

            array = System.Text.Encoding.ASCII.GetBytes(CEnumerator.Current.ToString());

            int asciicode = (short)(array[0]);

            if (asciicode != asc)
            {

                temp += CEnumerator.Current.ToString();

            }
            
        }
        return temp;
    }

posted on 2010-10-29 16:09  yanmiao  阅读(1145)  评论(0编辑  收藏  举报