Straight forward snippet to replace some text within a string.
1.
import
string
2.
3.
string.replace(
"TAB"
,
"A"
,
"B"
)
This will produce "TBB"
[ Source ]
Mainly notes to future-Twig (and for anyone else who may find them useful)
If you've found one or more of my blog posts helpful, why not say thanks by buying me a coffee or beer?
Straight forward snippet to replace some text within a string.
1.
import
string
2.
3.
string.replace(
"TAB"
,
"A"
,
"B"
)
This will produce "TBB"
[ Source ]