Asp classic Asp我想在使用空格时从url中剪切文本

Asp classic Asp我想在使用空格时从url中剪切文本,asp-classic,Asp Classic,例如,地址是:start 我想在使用空格时从url中剪切文本http://127.0.0.1.co.th/af 我想在使用空格时从url中剪切文本http://127.0.0.1.co.th/af 开始 (剪辑开始)你觉得怎么样 假设您试图从可能包含空格的字符串中剪切URL,那么您的代码非常接近。看起来您的第二个if语句有点不正确,需要截断URL 这应该起作用: <% str = "start http://127.0.0.1.co.th/af start" if instr(str,

例如,地址是:start

我想在使用空格时从url中剪切文本http://127.0.0.1.co.th/af
我想在使用空格时从url中剪切文本http://127.0.0.1.co.th/af 开始
(剪辑开始)你觉得怎么样

假设您试图从可能包含空格的字符串中剪切URL,那么您的代码非常接近。看起来您的第二个if语句有点不正确,需要截断URL

这应该起作用:

<% 
str = "start http://127.0.0.1.co.th/af start"

if instr(str,"http://")<> 0 then
    str = right(str,len(str) - instr(str,"http://") +1)
end if
if instr(str," ") <> 0 then
    str = left(str,instr(str," "))
end if
%>

<%=str%>

您想要的结果是什么?把“开始”变成“开始”?
<% 
str = "start http://127.0.0.1.co.th/af start"

if instr(str,"http://")<> 0 then
    str = right(str,len(str) - instr(str,"http://") +1)
end if
if instr(str," ") <> 0 then
    str = left(str,instr(str," "))
end if
%>

<%=str%>