Simple string replacement?

Hi everybody. Comming from Twig I’m wondering if there is a simple solution to replace some parts of a string somehow like this:
<?= $kurs->zeit()->kt()->inline()->replace('-','–') ?>

Yes, I saw this, but I don’t understand it. I need an example.

You can try following code:

echo $kurs->zeit()->callback(function ($field) {
  $field->value = str_replace('_', '-', $field->value);
  return $field;  

Oh, thanks, that works perfect. Is this really the shortes way?
And what about multiple replacements in one?

Is this really the shortes way?

For simple string, yes.

Also you can create own field methods:

Okay. Thank you very much. :beer: