如果 m,n,x,y是已知的,可以用mid函数。
解决方案 »
- VB winsock 速度问题
- 怎么在mschart中动态显示曲线
- 如何在系统托盘里面加上图标
- 欢迎好象不够热烈!再放一帖
- 关于下载,急!!!!!!!!!!
- 十万火急,请问,为何在ScriptControl中,不能使用程序中赋值的变量?
- API函数声明
- 请高手帮忙将下面C语言转换成VB语言,高分奉献!!!
- VB的DAO控件连接ACCESS的密码问题,100分
- 实时错误'453',找不到 DLL 入口点 Shell_NotifyIconA in shell32.dll
- 有什么工具可以得到.DLL文档中的函数的所有信息?(包括函数的参数,返回值)
- 求救啊!!!关于Dao打开Access加密数据库的问题。
Dim ba() As Byte
Dim i As Long, j As Long
ba = StrConv(Source, vbFromUnicode)
For i = 0 To UBound(ba)
If ba(i) >= 48 And ba(i) <= 57 Then
Part1 = Left$(Source, i)
Exit For
End If
Next
For j = i + 1 To UBound(ba)
If ba(j) < 48 Or ba(j) > 57 Then
Part2 = Mid$(Source, Len(Part1) + 1, (j - i))
Exit For
End If
Next
End Sub
如果是前者,只要:
Dim i As Integer, j As Integer
Dim astr1 As String, astr2 As String
Dim astr As String
i = (m) '这是得到用户输入的m值
j = (n)'这是得到用户输入的n值
astr = "ABCdn6470Abc123"
astr1 = Left(astr, i)
astr2 = Mid(astr, i + 1, j)这使,astr1与astr2就是你要的拉.如果是后者,就得:
Dim i As Integer, j As Integer, t As Integer, k As Integer
Dim astr1 As String, astr2 As String
Dim astr As String
astr = "ABCdn6470Abc123"
j = Len(astr)
k = 0
For i = 1 To j
t = Asc(Mid(astr, i, 1))
If t <= 57 And t >= 48 Then
astr2 = astr2 & Mid(astr, i, 1)
k = 1
Else
If k <> 0 Then Exit For
astr1 = astr1 & Mid(astr, i, 1)
End If
Next
这使,astr1与astr2就是你要的拉.