string Name = "Teste,"
string ReturnName = "";
ReturnName = Name.Remove(Name.Length - 1);
myString = myString.Substring(0, myString.Length-1);
myString = myString.Substring(0, myString.Length-3);
Something = Something.TrimEnd(',');
using System;
class RemoveCharacter {
static void Main() {
string s = "king";
string result = s.Remove(s.Length-1);
Console.WriteLine(result);
}
}
public static string ReplaceLastOccurrence(string Source, string Find, string Replace)
{
int place = Source.LastIndexOf(Find);
if(place == -1)
return Source;
string result = Source.Remove(place, Find.Length).Insert(place, Replace);
return result;
}
Console.Write("Abc");
Console.Write("");
Console.Write("Def");
using System;
class RemoveCharacter {
static void Main() {
string s = "king";
string result = s.Substring(0,s.Length-1);
Console.WriteLine(result);
}
}
Remove test