2013-07-02
展开全部
MID函数格式:
MID(source as string, startindex as integer, count as integer) as string
就是求字符串source中从startindex开始的count个字符然后返回。
startindex的计算是从1开始的(这个是VB的定义)。
比如 mid("abcdefg", 2, 3),得到的是:bcd
mid("abcdefg", 1, 2),得到的是:ab
mid("abcdefg", 1, 7),得到的是:abcdefg
mid("abcdefg", 4, 4),得到的是:defg
mid("abcdefg", 6, 1),得到的是:f
MID(source as string, startindex as integer, count as integer) as string
就是求字符串source中从startindex开始的count个字符然后返回。
startindex的计算是从1开始的(这个是VB的定义)。
比如 mid("abcdefg", 2, 3),得到的是:bcd
mid("abcdefg", 1, 2),得到的是:ab
mid("abcdefg", 1, 7),得到的是:abcdefg
mid("abcdefg", 4, 4),得到的是:defg
mid("abcdefg", 6, 1),得到的是:f
2013-07-02
展开全部
VB6 或者VB.NET的Mid 函数 和 C#中的 Substring 函数是一样的 .
怎么实现 上面已经给你解答了~
Mid函数大致是这样的
Function mid(ByVal str As String, ByVal startI As Integer, ByVal endI As Integer) As String
Dim r As String = ""
Try
Dim c As Char() = str.ToCharArray()
For x As Integer = startI To endI
r = r + c(x)
Next
Catch ex As Exception
End Try
Return r
End Function
怎么实现 上面已经给你解答了~
Mid函数大致是这样的
Function mid(ByVal str As String, ByVal startI As Integer, ByVal endI As Integer) As String
Dim r As String = ""
Try
Dim c As Char() = str.ToCharArray()
For x As Integer = startI To endI
r = r + c(x)
Next
Catch ex As Exception
End Try
Return r
End Function
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |