String Concat() - C# Tutorial
C# Course / Strings / String Concat()

String Concat()

BLUF: Mastering String Concat() is essential for building robust applications with the .NET ecosystem. This tutorial provides clear explanations and practical examples to help you understand and apply this C# concept.
Enterprise Development Tip: String Concat()

C# is a powerful, modern language for enterprise solutions. Discover how String Concat() enhances your development workflow in the guide below.

The Concatenation function in C# is employed to combine several string instances, yielding a single concatenated string. Various overloaded versions of Concatenation exist within C#.

Signature

Example

public static string Concat(String, String)
public static string Concat(IEnumerable<String>)
public static string Concat(Object)
public static string Concat(Object, Object)
public static string Concat(Object, Object, Object)
public static string Concat(Object, Object, Object, Object)
public static string Concat(params Object[])
public static string Concat(String, String, String)
public static string Concat(String, String, String,?String)
public static string Concat(params String[])
[ComVisibleAttribute(false)]
public static string Concat<T>(IEnumerable<T>)

Parameters

It takes two String object arguments.

Return

It returns a string object.

C# String Concat Method Example

Example

using System;  
    public class StringExample  
    {  
        public static void Main(string[] args)  
        {  
             string s1 = "Hello ";  
             string s2 = "C#";  
             Console.WriteLine(string.Concat(s1,s2));  
        }  
    }

Output:

Output

Hello C#

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience