I have a problem with getting a final file name in c#.
For example:
If user types two filenames:
"asd." and "asd.."
or
"asd " and "asd " (two spaces)
then method Path.GetFileName
returns "asd.", "asd..", "asd ", "asd " (two spaces).
After saving it on a hard drive (e.g. using StreamWriter), then there is only one file "asd"
How can I check the final name of the input file? I suppose there is a lot of other examples and I could never do it properly manually.
Edit:
I use it to compare two file names and GetFileName returns: for a.txt - a.txt for A.txt - A.txt
But after save it's the same file. The comparison must ignore case.