Use below code..
if(inputText.Trim().EndsWith("."))
{
string outputText = inputText.Remove(inputText.Length - 1, 1);
}
Here
inputText
is your gridview cell text.
Other way around is to create an extension method and call it to remove last char after checking if the last char is dot.
public static class MyExtensions
{
public static string TrimLastCharacter(this String str)
{
if(String.IsNullOrEmpty(str)){
return str;
} else {
return str.TrimEnd(str[str.Length - 1]);
}
}
}