Given the following string template and desired result, is there a simple (one-liner-type) way in Python to achieve this? I would want id to be incremented after/before a replacement.
"fruit-{id} fruit-{id} fruit-{id}"
"fruit-1 fruit-2 fruit-3"
Update: I realize I did not describe the problem very well and did not pick a good example. The template(s) are not usually regular like the fruit example.
It could be like...
"Lorem{id} ipsum dolor{id} sit amet, consectetur adipiscing elit{id}, sed do eiusmod{id} tempor incididunt..."
...where it is unclear how many id's there will be in the string.