C
Join ServerC#
help
❔ Is there a way to override the DefaultInterpolatedStringHandler?
Nnemui2/14/2023
So that just writing $"Something" immediately uses another handler.
AAngius2/14/2023
https://btburnett.com/csharp/2021/12/17/string-interpolation-trickery-and-magic-with-csharp-10-and-net-6 You can have custom handlers
AAngius2/14/2023
You can't overwrite the default, far as I know
AAngius2/14/2023
It'd be a nightmare and a half if you could
Nnemui2/14/2023
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.
OOrannis2/14/2023
If you overload your methods, it will prefer the overloads typed as handlers over ones typed as string
OOrannis2/14/2023
But you can't make
var s = $"{...}"
be typed as your own handler typeAAccord2/15/2023
Was 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.