For example, I have two string variables:
string a = " Hello ";
string b = " World ";
How can I swap it without a temporary variable?
I found an example, but it used a third variable for the length of a
:
int len1 = a.Length;
a = a + b;
b = a.Substring(0, len1);
a = a.Substring(len1);
How can I do that?
UPD, suggested solution for decimal data type, in ma case i've asked about string data type.