- 1

I was playing in the code playground after learning about the String.Concat in the static classes course. I have the following code, and was wondering if it's possible to put a period and space between the two texts, and how to put the second text on the next line. http://www.sololearn.com/app/csharp/playground/c0rAVF6X3KwP/

10th Aug 2016, 10:02 PM
Daniel Hildreth
Daniel Hildreth - avatar
4 Respuestas
+ 1
maybe this is what you are looking for... Console.WriteLine(String.Concat(s1,". \n",s2)); entire code if you wish to see it was same as urs.. here.. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string s1 ="Some Text"; string s2 = "Another text"; Console.WriteLine(String.Concat(s1,". \n",s2)); } } }
17th Sep 2016, 8:03 AM
Dharti Narwani
Dharti Narwani - avatar
- 1
Bw E week
25th Aug 2016, 2:48 AM
Naga Subrahmanyam k
Naga Subrahmanyam k - avatar
- 1
Bw E week
25th Aug 2016, 2:48 AM
Naga Subrahmanyam k
Naga Subrahmanyam k - avatar
- 2
I sid not put a period, But all you have to do is esit the variable. string s1 ="Some Text "; string s2 = "Another text"; Console.WriteLine(String.Concat(s1, s2)); string s3 ="Some Text "; string s4 = "Another text"; Console.WriteLine(String.Concat(s3)); Console.WriteLine(String.Concat(s4));
11th Aug 2016, 7:15 AM
Andreas BeEm Kvist
Andreas BeEm Kvist - avatar