❔ Is there a way to override the DefaultInterpolatedStringHandler?
So that just writing $"Something" immediately uses another handler.
4 Replies
https://btburnett.com/csharp/2021/12/17/string-interpolation-trickery-and-magic-with-csharp-10-and-net-6 You can have custom handlers
You can't overwrite the default, far as I know
It'd be a nightmare and a half if you could
Ye, but that's kind of what I was hoping for. I already made my own handler, just need a way to enforce it without being too intrusive.
If you overload your methods, it will prefer the overloads typed as handlers over ones typed as string
But you can't make
var s = $"{...}"
be typed as your own handler typeWas this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.