Home > Net >  Simple to use c # placeholders
Simple to use c # placeholders

Time:09-26

String. The formatter (" {0} {2} 2 three {1} ", 1 31);

The output is a 1-2 2 3 3

Assignment of the order is in accordance with the curly braces in 012

CodePudding user response:

New version of the c # also supports string inline:

String s= $ "{1} {2} 2 three {3}";

CodePudding user response:

Int one=1;
Int two=2;
Int three=3;

String s=${one} 2 "{two} three {three}";

CodePudding user response:

With the method of the second floor is more convenient, better readability

CodePudding user response:

reference 1st floor github_36000833 response:
new version of the c # also supports string inline:

String s= $ "{1} {2} 2 three {3}";

3 q?? , carefully looked at the thought, indeed, speaking, reading and writing are more convenient

CodePudding user response:

Learning,,,

CodePudding user response:

{} is formatted output
Want to output {
To the console. Writeline (string format (" {{"));

CodePudding user response:

You can write in the blog

CodePudding user response:

I usually use the $
  • Related