Hi guys, I need help in my program, which I am doing, I have everything clarified, but one thing.
My code looks something like this, but I cut it a bit ...
public static void mainvoid() { string line = Console.ReadLine().ToLower(); if (line == "restart") { Console.Clear(); Main(); } if (line == "enter a value: ") { string value = console.ReadLine(); console.writeline("Your value is {0}", value); mainvoid(); } if (line == "my name") { Console.WriteLine("Your name is {0}", ConsoleApplication1.Properties.Settings.Default.name); mainvoid(); }
I want my program to take the command (the witch I did ...), and some of them have values ββ/ lines after them. By the way, I am using C # 2010 I want my command to look like this:
My name is Daniel and therefore the line / value = Daniel or
name = bill therefore string / value = bill
So, I want him to pick it up via console.readline (); and select that it changes the name, and after that there will be a name into which it will be changed.
But I donβt know how to make the last bit a value / string, which I can also use ... Please leave a comment if you can help me :)
source share