Skip to content

Is there a way to specify ToUpper or ToLower when formatting data in an interpolated string? #98012

Answered by Joe4evr
tacosontitan asked this question in Q&A
Discussion options

You must be logged in to vote

The real question here is if casing can be specified when formatting data in an interpolated string.

That's a no, sadly. My other answer would work for anything ISpanFormattable if you're willing to change from interpolation to like a StringBuilder or something, or just live with the intermediate allocation.

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@tacosontitan
Comment options

Comment options

You must be logged in to vote
6 replies
@Clockwork-Muse
Comment options

@Joe4evr
Comment options

@tacosontitan
Comment options

@Joe4evr
Comment options

Answer selected by tacosontitan
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants