Sub Right($s As String, $length As Integer) As String


Returns a string containing the specified number of characters ($length) from the right side of $s.


If $length is 0, an empty string is returned. If $length specifies more characters than are available in $s, the entire string is returned.


Parameters


  • $s ... String expression from which the rightmost characters are returned.
  • $length ... Integer expression that specifies how many characters to return.


Example:

Dim $s, $s2

$s = "This is a text"
$s2 = Right($s, 6)
' returns $s2 = "a text"