I've got a string containing a processname like
string name = "firefox.exe", now I need to remove only the ".exe" part, so I get the processname without the ending. I tried to use
Console.WriteLine("output: " + processName.TrimEnd('.','e','x','e'));
But for some reasons output seems to be "firefo" without the "x". Any idea how to get this solved in an easy and clean way?
You ask it to trim the characters .
, e
and x
from the end, so it does that:
firefox.exe
firefox.ex
firefox.e
firefox.
firefox
firefo
how to get this solved in an easy and clean way?