1
2
3
4
5
6
7
8
9
10
|
/// <summary>
/// changes the extension of the given filename
/// </summary>
/// <param name="path">the filename</param>
/// <param name="newExtension">the new extension</param>
/// <returns>filename with new extension</returns>
private static string ChangeExtension(string path, string newExtension)
{
return Regex.Replace(path, @"\.[^.]*$", "." + newExtension);
}
|