Answers for "c# add char to string"

C#
1

c# add char to string

string s = "";
s = s + myChar.ToString(); // Where myChar is the char to be added
Posted by: Guest on July-11-2021
0

c# insert character into string at position

//Insert method returns a copy, it does not alter the string since strings are immutable
string str = "abc";
str = str.Insert(2, "XYZ"); //str == "abXYZc"
Posted by: Guest on September-28-2020

C# Answers by Framework

Browse Popular Code Answers by Language