c# list remove last code example
Example 1: c# remove last character from string
string Name = "Teste,"
string ReturnName = "";
ReturnName = Name.Remove(Name.Length - 1);
Example 2: c# remove last value from list
if(rows.Any()) //prevent IndexOutOfRangeException for empty list
{
rows.RemoveAt(rows.Count - 1);
}