Top  Previous  Next

function Right(sSource As String, iLength As Integer) As String


Returns a string containing a specified number of characters (iLength) from the right side of the string sSource.


If iLength is 0, an empty string is returned. If iLength specifies more characters than are available in sSource, the entire string is returned.




sSource ... String expression from which the rightmost characters are returned.
iLength ... Integer expression indicating how many characters to return.



Dim s, s2


= "This is a text"

s2 = Right(s, 6)

' returns s2 = "a text"