Чтобы удалить все дробные части, вы можете попробовать регулярные выражения :
using System.Text.RegularExpressions;
...
Regex regex = new Regex(@"(?<=[0-9]+)\.[0-9]+");
string result = regex.Replace(str, "");
Демо:
string[] tests = new string[] {
"i have rs 12.55",
"I have rs 12.55 and -8.63 but 0.78963",
"list : A.B.C.D",
"12 - 45... but 78.99"
};
Regex regex = new Regex(@"(?<=[0-9]+)\.[0-9]+");
string report = string.Join(Environment.NewLine, tests
.Select(test => $"{test,-40} => {regex.Replace(test, "")}")) ;
Console.Write(report);
Результат:
i have rs 12.55 => i have rs 12
I have rs 12.55 and -8.63 but 0.78963 => I have rs 12 and -8 but 0
list : A.B.C.D => list : A.B.C.D
12 - 45... but 78.99 => 12 - 45... but 78