Swaps a string expression for another string expression in a string.


Namespace: rocketsoftware.MVSP
Assembly: RocketMVSP (in RocketMVSP.dll)

Syntax

Visual Basic (Declaration)
Public Function Swap( _ 
   ByVal array As String,  _ 
   ByVal oldstr As String,  _ 
   ByVal newstr As String _ 
) As String
C#
public string Swap(
   string array,
   string oldstr,
   string newstr
)
C++
public:
 String Swap(
   String array,
   String oldstr,
   String newstr
) sealed 
J#
public string Swap(
   string array,
   string oldstr,
   string newstr
)
JScript
public  function Swap(
   array : String,
   oldstr : String,
   newstr : String
) : String

Parameters

array
is the string expression to search in
oldstr
is the old string to replace
newstr
is the new string

Return Value

a string with old string replace by the new string

Remarks



Example shows the swap function

 Copy Code
 Dim mvspfunctions as new rocketsoftware.MVSP.Functions
 Dim am as chr(254)
 Dim txt as string
 Dim result as string
 txt = "abc" & am & "def" & am & "ghi"
 result = mvspfunctions.Swap(txt,"def","xyz")
 

See Also