0

Can I add More than one input in a single String?

What if I want birth date and name both. I tried using s tring "yourName, dob"... but it shows error

7th Oct 2016, 6:58 AM
Raviyank Patel
Raviyank Patel - avatar
4 odpowiedzi
+ 1
Try this: string yourName = Console.ReadLine(); string bod = Console.ReadLine();
7th Oct 2016, 1:59 PM
Samuel Neo
Samuel Neo - avatar
0
Sounds like you need the abilities of StringBuilder. https://msdn.microsoft.com/de-de/library/system.text.stringbuilder(v=vs.110).aspx
28th Oct 2016, 2:24 AM
Idril
Idril - avatar
0
String also has some static features, like String.Concat. Another handy tool is formatted string. https://msdn.microsoft.com/de-de/library/system.string.format(v=vs.110).aspx
28th Oct 2016, 2:29 AM
Idril
Idril - avatar
0
If dob is of type DateTime, then dob.ToString() delivers its string representation.
28th Oct 2016, 2:32 AM
Idril
Idril - avatar