zl程序教程

您现在的位置是:首页 >  后端

当前栏目

C# 如何读取一行中的所有变量

c#变量 如何 所有 读取 一行
2023-09-27 14:29:12 时间
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            char[] delimiterChars = { ' ', ',', '.', ':', '\t' };
            string text = this.textBox1.Text;
            string[] words = text.Split(delimiterChars);
            foreach (String ss in words)
            {
                this.listBox1.Items.Add(ss);
            }
        }
    }
}