i have to remove the dot at the end of text howt to i do
usign c#, dot.net
example = abc.
i want this = abc
Go to variable view. click on Type. Change from numeric to string and the dots will disappear.
Edit > Replace, replace .
Try this:
string a = "abc.";
string b = a.TrimEnd('.');
You can remove any dots at the end of a string using the TrimEnd
method:
str = str.TrimEnd('.');
You can use the Substring
method to remove only the last character:
str = str.Substring(0, str.Length - 1);
If the last character should only be removed if it's a period, you can check for that first:
if (str[str.Length - 1] == '.') {
str = str.Substring(0, str.Length - 1);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With