asp classic - Asp I want to cut text from url when WhiteSpaces -
for example, address is: start http://127.0.0.1.co.th/af start
want cut text url when whitespaces http://127.0.0.1.co.th/af <% str = "start http://127.0.0.1.co.th/af start" # cut start url if instr(str,"http://")<> 0 str = right(str,len(str) - instr(str,"http://") +1) end if if instr(str," ") <> 0 str = left(str,instr(str," ") +3) end if %> <%=str%> want cut text url when whitespaces http://127.0.0.1.co.th/af start (cut start) how thk
assuming attempting cut out url string may contain spaces, code pretty close. looks second if statement off little bit truncate url.
this should work:
<% str = "start http://127.0.0.1.co.th/af start" if instr(str,"http://")<> 0 str = right(str,len(str) - instr(str,"http://") +1) end if if instr(str," ") <> 0 str = left(str,instr(str," ")) end if %> <%=str%>
Comments
Post a Comment