Forums
This topic is locked
How to truncate a displayed value
Posted 17 Oct 2002 23:35:29
1
has voted
17 Oct 2002 23:35:29 Chris Rowe posted:
I have a value "images/10403.jpg" that I would like to shorten to "10403.jpg" when I display it in a variable for the user to see. How would I go about doing that? Thanks in advance. Replies
Replied 18 Oct 2002 11:25:06
18 Oct 2002 11:25:06 Vince Baker replied:
If the value is coming from a database field:
<%=replace(recordsetname.fields.item("FieldName"
.value, images/, ""
%>
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
<%=replace(recordsetname.fields.item("FieldName"


Regards
Vince
Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 18 Oct 2002 15:50:56
18 Oct 2002 15:50:56 Chris Rowe replied:
Awesome! Thanks Vince! Also for future reference, what if it's coming from a variable on the page? How would I truncate that?