This function checks the specified file name and validates it based on the fact it can have a '*' character at the beginning of the filename, at the end of the filename, one at either end, or none at all.
IsValidFileNameResult([FileName])
Where:
FileName is the FileName to check
Rule | Meaning |
---|---|
IsValidFileNameResult("helloworld.txt") | This function validates the filename "helloworld.txt" and returns True as it is structurally and syntactically valid. |
FileName | Outcome |
---|---|
"helloworld.txt" | True |
"*file.txt" | True |
"file.txt*" | True |
"*file.txt*" | True |
"" | False |
"file*txt" | False |
"**file.txt" | False |
"file.txt**" | False |
"file.*" | False |
"*.txt" | False |
"*.*" | False |