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

how CLR identify vb file?

2504


Mainly Related to Oracle, DBMS , Oracle Stored Procedures, Functions, Oracle 9i Architecture, Redo logs..., Views,

1871


What is the entry point function of a DLL?

623


Wrtite a JCL for sorting a file with start from 36 postion lenth 9 excluding a num eq to 98768. for 3 marks mainframe

1471


can any method return type may be constructor , or that method name allow

1590






I want to insert date in the form of yyyy-mm-dd... if any changes happen while inserting date format want to show error meg...any one can solve this..??

1665


give idea for creating screen in abap

1654


what is the difference between read the data from table and infotype

2065


3 members in a pf.how we read 3 members without using ovrdbf.using rg pgms....

1682


is it possible to desable particular parameter of the normal orcle report based on some condition ?????? if yes,wht is the function for desabling a parameter...

1588


define profiler???

1616


If i have a dataset queried from Sql and I would like to insert the dataset into a specific node in an xml document how do I do this

1710


1. Write a program to create a sentence at runtime and count number of vowels in it ? 2. Write a program to get a string and to convert the 1st letter of it to uppercase ?

3218


A good website has the following conditions It should be interactive. It should contain at least 20 images. Title cannot be null and should contain at least 10 letters other than spaces and hyphen (-). The keywords should contain atleast three among the following list : "design", "Graphics", "lovely", "beautiful", "amazing" and "mesmerising" Write a method: boolean isGoodWebsite(boolean isInteractive, int numOfImages, String title,String keywords[]) isInteractive whether the site is interactive or not numOfImages Number of images on the website title Title of the website keywords Array of keywords in the website.

1790


Write code to read the records from a file and load any array of size 99?make sure that you take care of all the error conditions?

1588