DIAdem Help

Method: MidB for VBS

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

Method: MidB for VBS

Returns a specific number of bytes from a text.

vMidB = Object.MidB(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 MidB method returns the whole text from start onwards.
vMidBVariant
Receives the returned text.

The following example displays a part of a text:

Dim MyString
MyString = MidB("DIAdem is great", 15, 4)
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