Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ignore designated amount of characters from a thread 1

Status
Not open for further replies.

shopwise

Technical User
Sep 22, 2008
52
0
0
US
When I output a database field containing a file url such as:
images/tools.jpg, I need to always ignore the first 7 characters so that it reads: tools.jpg how would I apply this fix to the following code:

Code:
<%=images("url_img")%>
 
If you always know the replacement string, you can use something like <% =REPLACE(images("url_img"),"images/","") %>

Or if you know that you always want the string after the /, but might have anything in the path, you can use INSTRREV and RIGHT and LEN to extract the desired portion.

Something like this:
Code:
response.write RIGHT("images/testimage.jpg",LEN("images/testimage.jpg") - INSTRREV("images/testimage.jpg","/"))

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top