image.png
    image.png
    image.png

    1. using System;
    2. using System.Collections.Generic;
    3. using System.ComponentModel;
    4. using System.Data;
    5. using System.Drawing;
    6. using System.Linq;
    7. using System.Text;
    8. using System.Threading.Tasks;
    9. using System.Windows.Forms;
    10. namespace _9_17
    11. {
    12. public partial class Form1 : Form
    13. {
    14. public Form1()
    15. {
    16. InitializeComponent();
    17. }
    18. private void btnStat_Click(object sender, EventArgs e)
    19. {
    20. char[] c1 = { ' ' };
    21. String str = this.textBox1.Text;
    22. String[] splitStrings = new string[100];
    23. splitStrings = str.Split(c1);
    24. this.textBox2.Text = splitStrings.Length.ToString();
    25. }
    26. }
    27. }