Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions

Question

What is the purpose of

Answered: 1 week ago