VBS tutorial: function – left function


Left function

Returns a specified number of characters from the left of a string.

Left(string, length)



String expression whose leftmost character is returned. IfstringIf the parameter contains null, theNull


A numeric expression indicating the number of characters to return. If it is 0, return a zero length string (“”); If greater than or equal tostringParameter, the entire string is returned.


AvailableLenFunction determinationstringThe number of characters in the parameter.

The following example usesLeftThe function returns the left three letters of mystring:

Dim mystring, leftstringmystring = "vbscipt" leftstring = left (mystring, 3) 'leftstring contains "VBS".

be careful    LeftBFunction is used with byte data contained in a string.lengthInstead of specifying the number of strings to return, you specify the number of bytes.

Recommended Today

SQL exercise 20 – Modeling & Reporting

This blog is used to review and sort out the common topic modeling architecture, analysis oriented architecture and integration topic reports in data warehouse. I have uploaded these reports to GitHub. If you are interested, you can have a lookAddress:https://github.com/nino-laiqiu/TiTanI recorded a relatively complete development process in my hexo blog deployed on GitHub. You can […]