How to swap two String values without using a
third variable?

Answer Posted / parthag

In C#, C sharp

string str1 = "First";
string str2 = "Second";
str1 = string.Concat(str1, str2);
str2 = str1.Replace(str2,"");
str1 = str1.Replace(str2,"");

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there any standard procedure to test the application as a whole? Or How can I test complete application right from the requirement gathering?

1470


Find out the list of roles which gives access to GUI activities? thanks in advance

1721


WS-NUM PIC S9(05)V(02) SIGN TRAILING SEPARATE MOVE '0050000+' TO WS-NUM The value stored is 00500,00+ MOVE '0050000-' TO WS-NUM Then what is the value will be stored in WS-NUM? Am getting '-00500,00'.....>>> What should I declare to WS-NUM so that I can get correct values for both + & - signs.

1848


what are the 3 forms of a prolog term

2753


what is web configuration file

1541






When you deliver your C++ headers and C++ library of a class (what all can you change in the class so that application using your class does not need to recompile the code)

724


5.Call by value and Call by reference with program?

1831


Define Form modules, Class modules and Standard modules

1477


how do find the user exit for selected feild whatis the process and can u plz explain it

1721


What is %Type,%Rowtype?

1840


Q2. A memory location has physical address D5687h. Compute: a. The offset address if the segment number is D445h. b. The segment number if the offset address is B577h.

1629


What is ur porject Architecture? If anyone ask what i have to specify here..

1489


why we use mantis? what u mean mantis in IT trends? addvantages of mantis?

1738


what are stubs related to foxpro?

1660


I need source code for Enrollment System using Visual Basic 6.0/2008 database MS Access 2007 for my school thesis project...please help me..kindly send in my email jpinedamcp@gmail.com

1582