You don't need Regular expressions here.
Look at the class
System.IO.Path
. How about
System.IO.Path.ChangeExtension
and
System.IO.Path.GetExtension
,
System.IO.Path.GetFileName
and
System.IO.Path.GetFileNameWithoutExtension
? It will cover all you need. See:
http://msdn.microsoft.com/en-us/library/system.io.path.aspx[
^].
After all, you have
string.Split
.
A final note:
nothing "manipulates" strings — they are
immutable. All methods only read string data and created other data from scratch. Practically, this is good to know, for performance and other reasons.
—SA