Hi
If this is the filepath stored in a variable named str_input
Then we can directly use Path.GetFileNameWithoutExtension method to get the Filename alone like this
@bcorrea@Palaniyappan: The files are scanned images shared by end users to an inbox which will be downloaded to a folder by the bot. Unfortunately there are no rules set for the naming of the files.
@Palaniyappan:You have helped me earlier also.Appreciate your guidance and willingness to help.I have learned a lot going through your responses in this forum. It really matters for a newbie like me.
Both @Palaniyappan& @bcorrea gave the correct solution. Since forum does not allow to mark both answers as solution and as @bcorrea gave the solution first marking its as solution.