String manipulation, how to?

Can I do string manipulation in the template code? I’m using Zapier Integration and I wish to do the following:

input filename: prefix_name-suffix.jpg

I want to split the name of my file so I can use the prefix as a folder, and delete the -suffix.
Is that possible?