How can I format a string in Twig as follows:
For example: img = 05myphoto-Car.jpg
I need to remove the numeric prefix and -
I am mainly using this to output captions for images based on their filename
Desired Output:
Myphoto Car
I have tried this so far, from the docs:
{{ img |replace({'.jpg': "", '-' : " "}) }}
Outputs String
05myphoto Car
I also tried {{ replace({'range(0, 9)': ""}) }} // for numeric prefix - did not work