C# Text Processing some tasks