Trim whitespace characters from name when creating a new file
I just had a situation where I wanted to create a file with an exact name. To make sure I don't make any spelling mistakes, I copy&pasted the file name. Accidentally I also copied a new line character with it and as a result of the file name mismatch, things didn't work out. The trimming of whitespace characters would have saved me this headache, and I can't think of a situation where you would genuinely want those at the beginning or end of your file name.