Right

Extract a substring from a string, starting from the right-most character.

Syntax
      Right(string, NumberOfCharacters)

      Right$(string, NumberOfCharacters)

Key
   string              A string or string expression.

   NumberOfCharacters  The Number of characters to return

The Right() function can be used in VBA or in an SQL query.

Right() will return a Variant, Right$() will return a String.
You should use Right() if there is any chance of a Null value, since assigning Null to a String will raise an error.

Use the RightB function with byte data contained in a string. Instead of specifying the number of characters to return, length specifies the number of bytes.

Examples

Dim strDemo as String
strDemo = Right("Talent is just a skill you're willing to practice", 9 )
Msgbox strDemo
Returns "Talent is"

“Begin at the beginning, the King said, very gravely, and go on till you come to the end: then stop” ~ Lewis Carroll

Related

Left - Extract a substring from a string
Mid - Extract a substring from a string


 
Copyright © 1999-2024 SS64.com
Some rights reserved