stringbuilder join 2 strings c# code example

Example 1: 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;

Example 2: how add strings together

//Java
String firstName = "BarackObama";
String lastName = " Care";
//First way
System.out.println(firstName + lastName);
//Second way
String name = firstName + lastName;
System.out.println(name);
//Third way
System.out.println("BarackObama" + " Care");