How can I format a string in Twig as follows:
For example: img = 05myphoto-Car.jpg
img = 05myphoto-Car.jpg
I need to remove the numeric prefix and -
-
If you are willing to do it in the template, though it would be better as a controller/service, you can enable the preg_replace filter and strip numbers with something like preg_replace('/\d+/','') and use the capitalize filter in addition.
preg_replace('/\d+/','')