I\'m making a code to remove the file name and type from a path. However, i\'m receiving warnings concerning the line where i change the content from a character. How could i ge