I need to apply a simple filter to any text that will be printed to page using razor command @
.
in example see below codes:
public static class MyHelper
{
public string MyFilter(this string txt)
{
return txt.Replace("foo", "bar");
}
}
in this .cshtml view file
@{
var text = "this is foo!!";
}
<div>@text</div>
I expect somehow to print this is bar!!
instead of this is foo!!