0
Spacing the Input
Hi Guys How can I space the input? without changing - Console.WriteLine(fullName); Meaning if I enter: JohannesMokobi - it needs be Johannes Mokobi? using System; class Program { static void Main(string[] args) { Console.Write("input first name"); string firstName; firstName = Console.ReadLine(); Console.Write("input surname"); string surname; surname = Console.ReadLine(); string fullName; fullName = firstName + surname; Console.WriteLine(fullName); // input surname // results = name + surname // print results } }
3 Answers
+ 2
Change the following line:
fullName = firstName + surname;
Into following:
fullName = firstName + " " + surname;
Simply put a space in between firstName and surname.
Hth, cmiiw
+ 2
Thanks a million
+ 2
You're welcome mate, I'm glad if it helps : )