If the extension is un-known, so in your case it's PDF, this simply can be done by:
string fileName = string.Format("{0}.pdf","test..pdf (41 KB )".Split('.')[0]);
if you need more flexibility, can make PDF
as string variable too.
Do not simply replace, as the file can contain points too.