Answers for "replace first and last char in string c#\"

C#
38

how to replace last character of string in c#

string Name = "Teste,"
string ReturnName = "";
ReturnName = Name.Remove(Name.Length - 1);
Posted by: Guest on June-19-2020
1

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 and last char in string c#\"

C# Answers by Framework

Browse Popular Code Answers by Language