- 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/
4 Antworten
+ 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));
}
}
}
- 1
Bw
E week
- 1
Bw
E week
- 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));