1) Your example works:
But my does not work:
You can try it by yourself.
2) If I have variable that consists of filename for example:
var := "c:\1.txt"
And I want to trim some symbols with your function.
I am waiting that when I do this
tnen I will get var = 1.txt
The same as it can be done with substr():
How does your function understand what I want pass to it - reference to a file or simply variable?
3) Sorry I forgot to put quotes in function.
I mean this.
This code works as expected.
It creates 2 files: TestFile.txt and trimmed TestFile_copy.txt
But this one does not work as expected:
It creates 1 file: !TestFile.txt
So If I have file "!example.txt" then I can not edit this file with your library because your library does not support filenames that starts with "!" ?