Home > Code > C# > Insert a text into given string in a specific place using String.Insert() method in C#.NET

Insert a text into given string in a specific place using String.Insert() method in C#.NET

by Thamil   on Dec 19, 2011   Category: C#   |  Views: 917    |  Points: 25   |  Gold 



Sometime when you work with strings, we need to insert the string into given string at sepcific index position, below example will help you to insert at specific place.

using System;
using System.Text;


private void InsertString()
{
string SampleString = "Insert a string in a specific place using String.Insert() method in C#.NET";
SampleString = SampleString.Insert(9, "text into given ");
Response.Write(SampleString);

}




Post Code  |  Code Snippet Home

User Responses


No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts