Answers for "replace first character C#"

C#
0

remove first character in a string c#

// initial string is "/temp" it will be changed to "temp"
data.Remove(0,1);
data.TrimStart('/');
data.Substring(1);
Posted by: Guest on November-06-2020
0

replace first occurrence of character in string c#

var regex = new Regex(Regex.Escape("o"));
var newText = regex.Replace("Hello World", "Foo", 1);
Posted by: Guest on May-23-2021

Code answers related to "replace first character C#"

C# Answers by Framework

Browse Popular Code Answers by Language