+ 1
Зачем нужны метки {0}, {1} ну и такие метки
2 Réponses
+ 2
string s1 = "Привет ";
string s2 = "FanTop";
Console.WriteLine("{0}" + "{1}", s1, s2); //Привет FanTop
Где {0} и {1} маркеры подстановки, а s1 и s2 элементы подстановки
------------------------------
string s1 = "Hello ";
string s2 = "FanTop";
Console.WriteLine("{0}" + "{1}", s1, s2); //Hello FanTop
Where {0} and {1} substitution markers, s1 and s2 permutation elements
+ 1
They are called placeholders.
They hold the data you want to insert into the string.
It is just a way of doing it.
Strictly speaking you do not need it.
You can use
String concatenation
Placeholders
Or string interpolation
There are several ways to do things right.
https://code.sololearn.com/cZAfo3Y9ElXv/?ref=app