Removing File Extensions (Unsafe)

by Jul 14, 2011

Some users use Trim() to remove file extensions like this:


This seems to work great, but in reality, Trim() removes all the characters you submitted from the beginning and end of the text. Check this out:


The file name is missing the last "t" because "t" is part of the characters Trim() removes.


Twitter This Tip!
ReTweet this Tip!