Mid

Return a mid-section from a string.

Syntax 
      Mid(string , start [, length]

Key
   string   The text string (or string expression).
 
   start    The start position of the substring

   length   The length of the substring i.e. number of characters to return

Examples

'Display a message:

strSample="Partnum45"
WScript.Echo Mid(strSample,8,2)
> 45

“I would rather wake up in the middle of nowhere than in any city on earth” - Steve Mcqueen

Related:

Left(String,len) - Return the leftmost len characters of string
Right(String,len) - Return the rightmost len characters of string
Equivalent Powershell command: $result = $myvar.substring(2,3)



Back to the Top

© Copyright SS64.com 1999-2011
Some rights reserved