SoFunction
Updated on 2025-03-07

C# English word classification statistics example sharing


using System;
using ;
namespace ConsoleApplication1
{
    /// <summary>
/// Give a paragraph of English and classified statistics (for example: there are 2 words with length 4: time, well)
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
string source = "Do one thing at a time,and do well";//known English statements
            string[] stringArray = (new char[] { ' ', ',' });
            var result = (s => ).Select(s => new {
                Lenght = (x => x).FirstOrDefault().Length,
                Count = (),
                StringItems = (x => x)
            });
 
            foreach (var s in result)
            {
                string strResult = ;
                foreach (var item in )
                {
                    strResult += (strResult) ? item : " , " + item;
                }
(("There are {1} words with length {0}: {2}", , , strResult));
            }           
            ();
        }
    }
}