Filesystem: Improve GetCleanfilename to remove double dots and spaces

This commit is contained in:
Jonathan Jenne 2021-07-29 16:34:32 +02:00
parent 643e62aca1
commit fdc994e25f

View File

@ -55,6 +55,8 @@ Public Class File
Dim oCleanName As String = FileName
oCleanName = Regex.Replace(oCleanName, _invalidFilenameChars, String.Empty)
oCleanName = Regex.Replace(oCleanName, REGEX_CLEAN_FILENAME, String.Empty, RegexOptions.Singleline)
oCleanName = Regex.Replace(oCleanName, "\s{2,}", " ")
oCleanName = Regex.Replace(oCleanName, "\.{2,}", ".")
_Logger.Debug("Filename after cleaning: [{0}]", oCleanName)