Answers for "c# string concatenation"

C#
2

how to concatenate two strings in c#

using System;

namespace Concatenate{
  
	public class Program{
      	public static void Main()
      	{
          	string firstWord = "Hello";
          	string secondWord = " World!";

          	string concatenated = firstWord + secondWord;

          	Console.WriteLine(concatenated);
		}
  	}
}
Posted by: Guest on August-28-2021
3

c# String.Concat()

string first = "hello_";
string second = "world";
/* Unite multiple strings to one new string*/

string third = String.Concat(first, second);
// string third will be now "hello_world"
Posted by: Guest on March-26-2021
1

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");
Posted by: Guest on May-14-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
0

how to concate in c#

public static string Concat (string str1, string str2);
Posted by: Guest on August-10-2021
0

C# concatenation

// Declare strings    
string firstName = "Mahesh";    
string lastName = "Chand";    
    
// Concatenate two string variables    
string name = firstName + " " + lastName;    
Console.WriteLine(name);
Posted by: Guest on August-17-2021

Code answers related to "c# string concatenation"

C# Answers by Framework

Browse Popular Code Answers by Language