
- VBScript Tutorial
- VBScript - Home
- VBScript - Overview
- VBScript - Syntax
- VBScript - Enabling
- VBScript - Placement
- VBScript - Variables
- VBScript - Constants
- VBScript - Operators
- VBScript - Decisions
- VBScript - Loops
- VBScript - Events
- VBScript - Cookies
- VBScript - Numbers
- VBScript - Strings
- VBScript - Arrays
- VBScript - Date
- VBScript Advanced
- VBScript - Procedures
- VBScript - Dialog Boxes
- VBScript - Object Oriented
- VBScript - Reg Expressions
- VBScript - Error Handling
- VBScript - Misc Statements
- VBScript Useful Resources
- VBScript - Questions and Answers
- VBScript - Quick Guide
- VBScript - Useful Resources
- VBScript - Discussion
VBScript Right Function
Right
The Right Function returns a specified number of characters from the right side of the given input string.
Syntax
Right(String, Length)
String, a Required Parameter. Input String from which the specified number of characters to be returned from Right side.
Length, a Required Parameter. An Integer, which Specifies the number of characters to be returned.
Example
<!DOCTYPE html> <html> <body> <script language = "vbscript" type = "text/vbscript"> var = "Microsoft VBScript" document.write("Line 1 : " & Right(var,2) & "<br />") var = "MS VBSCRIPT" document.write("Line 2 : " & Right(var,5) & "<br />") var = "microsoft" document.write("Line 3 : " & Right(var,9) & "<br />") </script> </body> </html>
When you save it as .html and execute it in Internet Explorer, then the above script will produce the following result −
Line 1 : pt Line 2 : CRIPT Line 3 : microsoft
vbscript_strings.htm
Advertisements