Monday, February 1, 2010

Add Space Or Remove space on Variable

Remove the Space from the Variable

Dim MyValue,MyFunction,MyReturn
MyValue = "Vinodh Kumar"
MyFunction = split(MyValue, " " , -1,1)
MyReturn =MyFunction(0)& space(0) & MyFunction(1)
msgbox MyReturn

Add some Space from the Variable

Dim MyString, MyArray, MyReturn
MyString = "MDVDebuggerXForXVinodh"
MyArray = Split(MyString, "X", -1, 1)
msgbox myarray(0)
MyReturn = MyArray(0) & " " & MyArray(1)
MyReturn = MyReturn & " " & MyArray(2)
MsgBox MyReturn

No comments: