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

Answer Posted / parthag

In C#

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

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is abstract Method i want the exact definition and is there any possibility to declare class as abstract without any abstract methods in that class?If it is possible then tell me why and how?

1472


what is meant by life cycle of a business

1698


Write a shell program where you enter a number which corresponds to K.M. Find out the corresponding values in m, cm, inches, and feet. Hints:- 1 k.m= 1000 m 1 m= 100 cm 1 inches= 2.54 cm. 1 feet= 12 inches

1520


Please forward important interview and basic questions in VB6 on my email id: usneha_16@yahoo.co.in

1571


how to convert hashmap to arraylist with iteration

1196






hai i am mca 2009 fresher.please tell me which certification helps me to get an IT job faster which institute is good in hyderabad.please mail me to prasanna.1856@rediff.com

1524


5. How do you round the addition or subtraction of two numbers in assembler?

1773


difference between mantis and other tools?

1618


Tips for blog integration by www.esteemwebsolutions.com. Can Any body suggest me to how to make wonderful questions on web integration..

1646


What do you understand by modular programming?

670


if 3 duplicate records, by keeping one original and one duplicate record, and how to delete remaining 2 duplicates in sql server 2008

1593


Need provab technical test questions

2392


what is throws keyword

2990


Q1.Write a C program which asks the user for a number between 1 to 9 and shows the  number. If the user inputs a number out of the specified range, the program should  show an error and prompt the user for a valid input.

2273


what is the system development cycle

1261