adding function for parsing file extension from a string