C#去掉字符串中特定ASC码字符

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;
    }

原文地址:https://www.cnblogs.com/yanmiao/p/1864551.html