Right

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

Syntax
      Right(string, NumberOfCharacters)

Key
   string              A string or string expression.

   NumberOfCharacters  The Number of characters to return

Examples

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

A function to pad out a value with leading zeros:

Function LPad(strValue, intLength)
  LPad = Right("00" & strValue, intLength)
End Function
mydemo=LPad(4 2)
wscript.echo mydemo Returns: 04

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

Related VBScript commands

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


 
Copyright © 1999-2024 SS64.com
Some rights reserved