?? vbs156.htm
字號:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"><HTML><HEAD><TITLE>Mid Function</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso8859-1">
<META NAME="MS.LOCALE" CONTENT="EN-US">
<META NAME="PRODUCT" CONTENT="Visual Basic Scripting Edition">
<META NAME="TECHNOLOGY" CONTENT="SCRIPTING">
<META NAME="CATEGORY" CONTENT="Language Reference">
<META NAME="Keywords" CONTENT="Mid function,MidB function,middle,strings substrings,returning substrings,substrings returning,strings within strings,strings middle characters,strings,substrings"><META NAME="Description" CONTENT="Mid Function"></HEAD><BODY BGCOLOR=FFFFFF LINK=#0033CC>
<!--TOOLBAR_START-->
<!--TOOLBAR_EXEMPT-->
<!--TOOLBAR_END-->
<FONT FACE="Verdana, Arial, Helvetica" SIZE=2>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR VALIGN=TOP><TD WIDTH=360>
<FONT SIZE=1 COLOR=#660033>Microsoft® Visual Basic® Scripting Edition</FONT><BR>
<FONT SIZE=5 COLOR=#660033><B>Mid Function</B></FONT>
</TD>
<TD ALIGN=RIGHT>
<FONT SIZE=2> <A HREF="vbstoc.htm">Language Reference</A> <BR>
<A HREF="vbs16.htm">Version 1</A> <P></FONT>
</TD></TR>
</TABLE>
<FONT SIZE=2>
<P><A HREF="vbs157.htm">See Also</A></FONT>
<HR NOSHADE SIZE=1>
<H5>Description</H5>
<BLOCKQUOTE>Returns a specified number of characters from a string.</BLOCKQUOTE>
<H5>Syntax</H5>
<BLOCKQUOTE><b>Mid(</b><i>string</i><b>, </b><i>start</i>[<b>, </b><i>length</i>]<b>)</b><P>
The <b>Mid</b> function syntax has these arguments:<P>
<TABLE WIDTH=87% BORDER=1 CELLPADDING=5 CELLSPACING=0>
<TR VALIGN=TOP BGCOLOR="#DDDDDD">
<TD><FONT SIZE=2><b>Part</b></FONT></TD>
<TD><FONT SIZE=2><b>Description</b></FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>string</i></FONT></TD>
<TD><FONT SIZE=2><A HREF="vbs0.htm#defStringExpression">String expression</A> from which characters are returned. If <i>string</i> contains <A HREF="vbs0.htm#defNull"><b>Null</b></A>, <b>Null</b> is returned. </FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>start</i></FONT></TD>
<TD><FONT SIZE=2>Character position in <i>string</i> at which the part to be taken begins. If <i>start</i> is greater than the number of characters in <i>string</i>, <b>Mid</b> returns a zero-length string ("").</FONT></TD></TR>
<TR VALIGN=TOP>
<TD><FONT SIZE=2><i>length</i></FONT></TD>
<TD><FONT SIZE=2>Number of characters to return. If omitted or if there are fewer than <i>length</i> characters in the text (including the character at <i>start</i>), all characters from the <i>start</i> position to the end of the string are returned.</FONT></TD></TR></TABLE></BLOCKQUOTE><P>
<H5>Remarks</H5>
<BLOCKQUOTE>To determine the number of characters in <i>string</i>, use the <b>Len</b> function.
<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0 WIDTH=87%><TR><TD COLSPAN=2 VALIGN=BOTTOM><hr noshade size=1></TD></TR>
<TR><TD VALIGN=TOP><FONT SIZE=2><b>Note</b> The <b>MidB</b> function is used with byte data contained in a string. Instead of specifying the number of characters, the arguments specify numbers of bytes.</FONT></TD></TR>
<TR><TD COLSPAN=2 VALIGN=TOP><hr noshade size=1></TD></TR></TABLE></BLOCKQUOTE>
<hr noshade size=1>
<p align=center><em><a href="../../common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
</FONT></BODY></HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -