ArrayList itemList = new ArrayList();
            CharEnumerator CEnumerator = textBox1.Text.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 >= 48 && asciicode <= 57)
                {
                    itemList.Add(CEnumerator.Current.ToString());
                }
                textBox2.Text = itemList.Count.ToString();
            }

 

 

            ArrayList itemList = new ArrayList();
            CharEnumerator CEnumerator = textBox1.Text.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 >= 48 && asciicode <= 57) || (asciicode >= 65 && asciicode <= 90) || (asciicode >= 97 && asciicode <= 122))
                {
                    itemList.Add(CEnumerator.Current.ToString());
                }
                textBox2.Text = itemList.Count.ToString();
            }

相关文章:

  • 2021-08-31
  • 2021-06-19
  • 2021-10-13
  • 2021-10-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-20
  • 2021-11-13
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案