This is super dumb, but I checked the links and checked the links and I just can't find the answer ... Why int or float etc. can be added as part of a line without conversion, but not on it? i.e:
so far this work is wonderful:
string st = "" + 12;
this is not (of course):
string st = 12;
Where is the magic here? I know this works. I just want to know WHY this works, and how I control HOW the conversion is done?
+ , + . , . ( ToString()), .
+
ToString()
, int string.
int
string
, , () .
, BoltClock , + . # , :
, ToString, object.
ToString
object
String concats .NET String.Concat . , , mutliple concatenations.
, , String.Concat object , int, float .. , Concat, object. Internally Concat .ToString() -, int .
.ToString()
, String.Concat(object). 12 st.
String.Concat(object)
st
, , , , .
.ToString() , - .
- + .
# .
- , .
, , , , toSting.
, String.Concat().
String.Concat()
Inside, all operands are placed in a box (if necessary) and passed to the method String.Concat(which, of course, calls ToString()for all arguments).
String.Concat
Source: https://habr.com/ru/post/1781238/More articles:ObservableCollection update related to Pivot errors for SelectedIndex> = 2 (wp7) - windows-phoneHow to represent functions in a flowchart? - cPhp imagettftext always draws black - phpCan I pass a value from a form to a popup, display something based on what was submitted, and then pass something back? - javascriptExport ebay items / import to ZenCart - phpFacebook api search. - apiErasing a container element using iterators - c ++Пользовательская проверка jQuery: номер телефона, начинающийся с 6 - jqueryUnicode library for creating / processing Json documents (C ++) - c ++Connection in .Net - c #All Articles