5 th Apr 2020 01:39:41
Hai Friend , Sign In
Home
World
INDIA
Chennai City
Games
Developers
Members
Birthday
Search
Astrology
G. K.
Story
Tamil Nadu Government Holiday List 2018 in English and Tamil   *   Trichy: Wanted - PHP, MySql Programmers. Contact trichy people only 84894 28 444.   *   Indian Railways New Train Number List [Search / Enquiry / Locator / Finder]   *   பன்றிக் காய்ச்சல் பற்றி அறிந்து கொள்ளுங்கள் (Swine Flu H1N1)
See Also
Left Function Left Function
Right Function Right Function
Trim Function Trim Function
LTrim Function LTrim Function
RTrim Function RTrim Function
String Functions String Functions
Visual Basic Functions Visual Basic Functions
Visual Basic Home Visual Basic Home
 
Description  Syntax  Return Datatype  Example  Migration

Mid Function - Visual Basic 6.0 (VB 6.0)

Returns or replace a specified number of characters from a string.
Syntax:
Mid(string,start[,length])[=string1]
Parameter Description
string Required. Any valid string expression.
start Required. Any valid numeric expression.
length Optional. Numeric expression indicating how many characters to return.
string1 Optional. Any valid string expression. To replace a specified number of characters in a string.

Return Data type:
String
Example:
Statement Result Remark
Mid("abcd", 2) bcd  
Mid("abcd", 0)   Empty String
Mid("abcd", 5)   Empty String
Mid("abcd", 2, 2) bc  
Mid("abcd", 5, 2)   Empty String
Mid("abcd", 1, 4) abcd  
Mid("abcd", 1, len("abcd")) abcd  
Mid("abcd", null) Error Invalid use of null
Mid("abcd", 3, null) Error Invalid use of null
Mid(null, 3, 2) Null  
Mid("abcd", True) Error Invalid procedure call or argument
Mid("abcd", False) Error Invalid procedure call or argument
Mid(unknown, 3)   Empty String

Dim St as String
St = "abcd"


Statement Result Remark
Mid(St, 2, 2) = "xy"
Msgbox St
axyd  
Mid(St, 2, 3) = "xy"
Msgbox St
axyd  
Mid(St, 2, 3) = "xyz"
Msgbox St
axyz  
Mid(St, 2, 2) = "xyz"
Msgbox St
axyd  
Mid("abcd", 2, 2) = "xyz" Error Expected: variable
Go to top

Migration from Visual Basic 6.0 (VB 6.0) to
  Mid Function in VB Script (VBS)
  Mid Function in JScript (JS)
  Mid Function in ASP (Active Server Page)
  Mid Function in PHP Script
  Mid Function in MS-Access
  Mid Function in MS SQL Server
  Mid Function in Oracle
  Mid Function in C Language
  Mid Function in C++ Language
  Mid Function in Foxpro
  Mid Function in Fortran
  Mid Function in MS Excel Sheet
Go to top
 





© 2005 - 2007 Chennaiiq.com. All Rights Reserved.

Our Sites: ChennaiIQ.com || Tamil Calendar || Tamil Panchangam || KP Astrology
Our Blogs: Tamil Calendar



10234