SIL.FieldWorks.UnicodeCharEditor.PUAInstaller.ChangeFileExtension C# (CSharp) Method

ChangeFileExtension() public static method

Replace the file extension with 'newExtension'.
public static ChangeFileExtension ( string inputFilespec, string newExtension ) : string
inputFilespec string Input file name to modify.
newExtension string The new file Extension.
return string
		public static string ChangeFileExtension(string inputFilespec, string newExtension)
		{
			int index = inputFilespec.LastIndexOf('.');
			string newName;

			if (index == -1)
			{
				newName = inputFilespec + "." + newExtension;
			}
			else
			{
				newName = inputFilespec.Substring(0, index);
				newName += "." + newExtension;
			}
			return newName;
		}