DIAdem Help

Method: Mid for VBS

  • Updated2024-09-12
  • 1 minute(s) read

Method: Mid for VBS

Returns a specific number of characters from a text.

vMid = Object.Mid(string, start, [length])
ObjectVBS
Object with this method. You do not need to specify this object.
stringVariant
Specifies the text.
startVariant
Specifies the position from where the returned character string starts. If the value is greater than the length of the text, the method Mid returns an empty character string.
[length]Variant
Specifies the number of characters to return. If you do not enter the value, or there are less characters in the text than specified, the Mid method returns the whole text from start onwards.
vMidVariant
Receives the returned text.

The following example displays a part of a text:

Dim MyString
MyString = Mid("DIAdem is great", 8, 2)
Call MsgBox(MyString) ' Returns "is"

See Also

Objects Overview

Related Topics

Filter | InStr | InStrB | InStrRev | Join | LCase | Left | LeftB | Len | LenB | LTrim | Mid | MidB | Replace | Right | RightB | RTrim | Space | Split | StrComp | String | StrReverse | Trim | UCase

Log in to get a better experience