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

Answer Posted / andy

'Swapping two strings in vb.net
Private Function SwappStrings(ByVal str1 As String,
ByVal str2 As String) As String
str1 = str1 + str2
str2 = str1.Substring(0, (str1.Length -
str2.Length))
str1 = str1.Substring(str2.Length)
SwappStrings = "A is : " & str1.ToString & "And B
is : " & str2.ToString
End Function

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is class is a abstract datatype in java?

1447


in IT trend mantis meant what? how to know mantis in IT trends? detail description about mantis?

1645


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)

723


how CLR identify vb file?

2498


in a VB application, where the data will be stored after manipulation? what is the syntax for that?

1818






sample code for data transfer between two r/2 systems and r/3 systems?

1491


what is the last ant version you worked?how to get it

1461


Where do we need Operator overloading?

649


what is the use MDM(Master Data Management)and meaning

1901


Which design patterns have you used?

1548


smal talk is pure object oriented or not?

1525


What are events in smartforms?

1776


Explain three modes in which files can be accessed from python program

1321


how to remove header and footer in jcl using sort utility

5095


what is the certificates in biztalk?

1428