vb的mid$()函数,是什么函数?
1个回答
展开全部
Mid是Visual Basic和Microsoft Excel中的一个字符串函数,作用是从一个字符串中截取出指定数量的字符。
VB中语法:
Mid(String As Variant, Start As Long, [Length As Variant]) As Variant
Mid$(String As String, Start As Long, [Length As Variant]) As String
VB示例:
下面的示例展示了VB中如何使用Mid函数。其中所有的“Mid”都可以用“Mid$”代替。
DimvAsString
v=Mid("VisualBasic",0,12)'提示实时错误5
v=Mid("VisualBasic",1,6)'v的值为"Visual"
v=Mid("VisualBasic",1,20)'v的值为"VisualBasic"
v=Mid("VisualBasic",8)'v的值为"Basic"
v=Mid("VisualBasic",15)'v的值为空字符串
v=Mid("中文VB",2,2)'v的值为"文V"
VB中语法:
Mid(String As Variant, Start As Long, [Length As Variant]) As Variant
Mid$(String As String, Start As Long, [Length As Variant]) As String
VB示例:
下面的示例展示了VB中如何使用Mid函数。其中所有的“Mid”都可以用“Mid$”代替。
DimvAsString
v=Mid("VisualBasic",0,12)'提示实时错误5
v=Mid("VisualBasic",1,6)'v的值为"Visual"
v=Mid("VisualBasic",1,20)'v的值为"VisualBasic"
v=Mid("VisualBasic",8)'v的值为"Basic"
v=Mid("VisualBasic",15)'v的值为空字符串
v=Mid("中文VB",2,2)'v的值为"文V"
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询