"format" in $"{0:format}" should support interpolated-style or verbatim-style format #3766
Replies: 8 comments
-
This was already possible from start, and relaxed by #1630 . |
Beta Was this translation helpful? Give feedback.
-
No, that issue is unrelated to this one. @Sunnie-Shine, I'm sorry but I have no idea what separates these strings from regular interpolated or verbatim interpolated strings. Could you elaborate? |
Beta Was this translation helpful? Give feedback.
-
@333fred The examples confused me quite a lot too. If I understand it correctly, the goal is to modify how format strings behave in the following way:
@Sunnie-Shine Did I represent your proposal accurately? Personally, I can see the usefulness in allowing non-constant format string and alignment in interpolated strings, though I'm not convinced it could get over the "-100 points" hurdle. Also, I think the " |
Beta Was this translation helpful? Give feedback.
-
@svick Yes! I mean this! This "clumsy" syntax is only for reference and can be modified during implementation. Although non-constant interpolated strings can be used rarely, this syntax is powerful sometimes, I think. |
Beta Was this translation helpful? Give feedback.
-
@333fred I'm sorry for the wrong examples 😭 . In fact I means the pad length value (Using |
Beta Was this translation helpful? Give feedback.
-
@huoyaoyuan I may not see the topic in that link >_< |
Beta Was this translation helpful? Give feedback.
-
I don't like this for the simple reason that it would add more time to debugging and reading code. I think this would also introduce some issues with Razor. |
Beta Was this translation helpful? Give feedback.
-
@Frozenthia The only reason for why the identifier put on the tail of the string is that, the combination |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sometimes I want to use interpolated or verbatim strings at the format part in the interpolated strings, but the code is complicated. Therefore, this idea is born:
Allow the identifier
$
and@
at the tail of the interpolated string, which means the format string part can be interpolated and verbatim.The examples are:
Thx!
Beta Was this translation helpful? Give feedback.
All reactions