should I use str_replace() or is there a better drupal way for that?
You can either create your own tokens in a custom module or use strtr (it's easier for multiple search and replace operations than str_replace).

To see how to create custom tokens and integrate with token module see token_example module in Examples.