NeoSki
New member
- Joined
- Mar 9, 2021
- Messages
- 1
- Programming Experience
- 1-3
Hello, I wish to modify the string
name
from the method username
, but it doesn't seem to work with the below code:
C#:
class Program
{
//string to modify
string name = null;
public void username()
{
Console.Clear();
//Get user name
Console.Write("\nWhat's your name? ");
//edit string - doesn't work?
string name = Console.ReadLine();
Console.Clear();
return;
}
}