Answers for "c# Add or Concatenate Strings In C#"

C#
4

how to append something to a string in c#

string fName = "hello ";    
string lName = "world";    
string Name = string.Concat(fName, lName); 
//or
string firstName = "hello ";    
string lastName = "world";    
string name = firstName + " " + lastName;
Posted by: Guest on October-15-2020
2

c# string concatenation

string userName = "<Type your name here>";
string dateString = DateTime.Today.ToShortDateString();

// Use the + and += operators for one-time concatenations.
string str = "Hello " + userName + ". Today is " + dateString + ".";
System.Console.WriteLine(str);

str += " How are you today?";
System.Console.WriteLine(str);
Posted by: Guest on October-14-2020
-2

c# Add or Concatenate Strings In C#

string str1 = "ppp";  
string strRes = str1.Insert(2, "bbb");  
Console.WriteLine(strRes.ToString());
Posted by: Guest on December-12-2020

C# Answers by Framework

Browse Popular Code Answers by Language