Question: Can you solve this C# without using string builder. maybe using delimiter using System; using System.Collections.Generic; using System.Text.RegularExpressions; using static System.Console; using System.Text; namespace ParseWords

Can you solve this C# without using string builder. maybe using delimiter

using System; using System.Collections.Generic; using System.Text.RegularExpressions; using static System.Console; using System.Text; namespace ParseWords { public class Program { ///

/// The GetWordList method accepts a string which will be processed to /// obtain a list of words. A word is defined to be a contiguous /// sequence of alphabetic symbols, i.e. elements of the set /// {'a',...,'z','A',...,'Z'} /// The results will be returned in a list, with each entry appearing /// in the order in which it appears in the input string. /// All non-alphabetic symbols, including spaces, punctuation, and digits, /// must be eliminated. /// /// /// A string containing zero or more words. /// /// /// A list which contains the sequence of words extracted from the input string. ///

// INSERT CODE HERE } public static void Main(string[] args) { const string PROMPT = "Please enter words with optional punctuation, or an empty string to exit:"; const string PREAMBLE = "Invoking GetWordList with input \t{0}"; const string RESULTS = "Result = {{ '{0}' }}";

while (true) { WriteLine(PROMPT); string userInput = ReadLine().Trim();

if (userInput == null || userInput.Length == 0) break;

WriteLine(PREAMBLE, userInput); List words = GetWordList(userInput); WriteLine(RESULTS, string.Join("', '", words)); WriteLine(); } } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!