CSharp - String String concatenation

Introduction

The + operator concatenates two strings:

string s = "a" + "b";

If One of the operands is not a string value, ToString is called on that value. For example:

string s = "a" + 5;  // a5

Demo

using System;
class MainClass//from  ww  w  .j a va 2s .  co  m
{
   public static void Main(string[] args)
   {
       string s = "a" + 5;  // a5
       Console.WriteLine(s);

   }
}

Result

Exercise