VBScript Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 4.01

Built-in Functions

Part:   1  2   3 

VB Script Tutorials - Herong's Tutorial Notes © Dr. Herong Yang

Data Types and Literals

Variables

Logic Operations

String Operations

Conditional Statements

Arrays

Loop Statements

Functions and Subroutines

Built-in Functions

Variable Inspection

... Table of Contents

(Continued from previous part...)

String Functions

  • InStr(sString, sSubString) - Returns the position of the first occurrence of one string within another. The search begins at the first character of the string
  • InStrRev(sString, sSubString) - Returns the position of the first occurrence of one string within another. The search begins at the last character of the string
  • LCase(sString) - Converts a specified string to lowercase
  • Left(sString, iLen) - Returns a specified number of characters from the left side of a string
  • Len(sString) - Returns the number of characters in a string
  • LTrim(sString) - Removes spaces on the left side of a string
  • RTrim(sString) - Removes spaces on the right side of a string
  • Trim(sString) - Removes spaces on both the left and the right side of a string
  • Mid(sString, iStart, iLen) - Returns a specified number of characters from a string
  • Replace(sString, sOld, sNew) - Replaces a specified part of a string with another string a specified number of times
  • Right(sString) - Returns a specified number of characters from the right side of a string
  • Space(iLen) - Returns a string that consists of a specified number of spaces
  • StrComp(sString1, sString2) - Compares two strings and returns a value that represents the result of the comparison
  • String(iLen, sChar, iLen) - Returns a string that contains a repeating character of a specified length
  • StrReverse(sString) - Reverses a string
  • UCase(sString) - Converts a specified string to uppercase
  • Asc(sString) - Converts the first letter in a string to ANSI code
  • Chr(iInteger) - Converts the specified ANSI code to a character

Date and Time Functions

  • CDate(vVariant) - Converts a valid date and time expression to the variant of subtype Date
  • Date() - Returns the current system date
  • DateAdd(sType, iInterval, tDate) - Returns a date to which a specified time interval has been added
  • DateDiff(tDate1, tDate2) - Returns the number of intervals between two dates
  • DatePart(sType, tDate) - Returns the specified part of a given date
  • DateSerial(iYear, iMonth, iDate) - Returns the date for a specified year, month, and day
  • DateValue(vVariant) - Returns a date
  • Day(tDate) - Returns a number that represents the day of the month (between 1 and 31, inclusive)
  • FormatDateTime(tDate, iType) - Returns an expression formatted as a date or time
  • Hour(tDate) - Returns a number that represents the hour of the day (between 0 and 23, inclusive)
  • IsDate(vVariant) - Returns a Boolean value that indicates if the evaluated expression can be converted to a date
  • Minute(tDate) - Returns a number that represents the minute of the hour (between 0 and 59, inclusive)
  • Month(tDate) - Returns a number that represents the month of the year (between 1 and 12, inclusive)
  • MonthName(iMonth) - Returns the name of a specified month
  • Now() - Returns the current system date and time
  • Second(tDate0 - Returns a number that represents the second of the minute (between 0 and 59, inclusive)
  • Time() - Returns the current system time
  • Timer() - Returns the number of seconds since 12:00 AM
  • TimeSerial(iHour, iMinute, iSecond) - Returns the time for a specific hour, minute, and second
  • TimeValue(tDate) Returns a time
  • Weekday(tDate) - Returns a number that represents the day of the week (between 1 and 7, inclusive)
  • WeekdayName(iWeekDay) - Returns the weekday name of a specified day of the week
  • Year(tDate) - Returns a number that represents the year

Array Functions

  • Array(vArg1, vArg2, ...) - Returns a variant containing an array
  • IsArray(vVariant) - Returns a Boolean value that indicates whether a specified variable is an array
  • Join(aArray) - Returns a string that consists of a number of substrings in an array
  • LBound(aArray) - Returns the smallest subscript for the indicated dimension of an array
  • Split(sString, sDelimiter) - Returns a zero-based, one-dimensional array that contains a specified number of substrings
  • UBound(aArray) - Returns the largest subscript for the indicated dimension of an array

(Continued on next part...)

Part:   1  2   3 

Dr. Herong Yang, updated in 2006
VBScript Tutorials - Herong's Tutorial Notes - Built-in Functions