0

Full question in description programming language c#

Command Line Have the function CommandLine(str) take the str parameter being passed which represents the parameters given to a command in an old PDP system. The parameters are alphanumeric tokens (without spaces) followed by an equal sign and by their corresponding value. Multiple parameters/value pairs can be placed on the command line with a single space between each pair. Parameter tokens and values cannot contain equal signs but values can contain spaces. The purpose of the function is to isolate the parameters and values to return a list of parameter and value lengths. It must provide its result in the same format and in the same order by replacing each entry (tokens and values) by its corresponding length. For example, if str is: "SampleNumber=3234 provider=Dr. M. Welby patient=John Smith priority=High" then your function should return the string "12=4 8=12 7=10 8=4" because "SampleNumber" is a 12 character token with a 4 character value ("3234") followed by "provider" which is an 8 character token

8th Nov 2021, 3:09 AM
Amit
Amit - avatar
1 Answer
+ 1
Amit Here is a possible way to write the function to work as you wanted, except for values with spaces. Next time, try to make the code on your own as not everyone will be so kind to do it for you. If you have more questions, don't mind asking, but come up with a real problem and a code. https://code.sololearn.com/cPKPbWZrGWib/?ref=app
14th Nov 2021, 10:04 AM
Maisu
Maisu - avatar