Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/string/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
String 删除字符串中的字符,直到在ASP和VB中找到数字_String_Asp Classic_Vbscript - Fatal编程技术网

String 删除字符串中的字符,直到在ASP和VB中找到数字

String 删除字符串中的字符,直到在ASP和VB中找到数字,string,asp-classic,vbscript,String,Asp Classic,Vbscript,我正在尝试添加到其他人编写的页面。我需要获取一个字符串,该字符串的格式为3或4个字母字符,后跟一系列数字。我需要删除这些字母字符,这样只剩下一串数字 例如: 我使用的字符串是TrailerNumber=“CIN0012345” 我需要将结果设置为TrailerNumberTrimed=“0012345” 这是一个用ASP(显然不是ASPX)和VB页面编写的web应用程序。此代码必须在服务器上运行,因为它正被用作数据库中的搜索值。未测试,但应该可以工作(假设字符串的开头始终为3/4 alpha,后

我正在尝试添加到其他人编写的页面。我需要获取一个字符串,该字符串的格式为3或4个字母字符,后跟一系列数字。我需要删除这些字母字符,这样只剩下一串数字

例如: 我使用的字符串是TrailerNumber=“CIN0012345” 我需要将结果设置为TrailerNumberTrimed=“0012345”


这是一个用ASP(显然不是ASPX)和VB页面编写的web应用程序。此代码必须在服务器上运行,因为它正被用作数据库中的搜索值。

未测试,但应该可以工作(假设字符串的开头始终为3/4 alpha,后跟所有数字):


你有什么问题吗?你能把你目前掌握的密码发出去吗?
Dim TrailerNumberTrimed 

If IsNumeric(Right(TrailerNumber, Len(TrailerNumber) - 4)) Then
    TrailerNumberTrimed = Right(TrailerNumber, Len(TrailerNumber) - 4)
End If

If IsNumeric(Right(TrailerNumber, Len(TrailerNumber) - 3)) Then
    TrailerNumberTrimed = Right(TrailerNumber, Len(TrailerNumber) - 4)
End If

' At this point, you should have the correct trimmed trailer number