Print Page | Close Window

Changing a string

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5230
Printed Date: 28 March 2026 at 2:24am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Changing a string
Posted By: pmormr
Subject: Changing a string
Date Posted: 23 August 2003 at 5:29pm

Is there any way to turn this:

<IMG SRC="www.mysite.com/myfile.jpg">

into this?

www.mysite.com/myfile.jpg

any help is appreciated!



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Replies:
Posted By: pmormr
Date Posted: 23 August 2003 at 5:30pm
using asp, so theres no confusion...

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: michael
Date Posted: 23 August 2003 at 5:36pm

Is the value in a varible or where? You could use simply the replace function if that is the case.



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: b_bonnett
Date Posted: 23 August 2003 at 5:38pm

You could probably do it with a RegExp (Regular Expression) but I'm not much good with them so I'd use InStr and Mid:

intStart = InStr(strImg, """") + 1
intEnd = InStr(intStart, strImg, """") - 1
strFinal = Mid(strImg, intStart, intEnd)

(Here, strImg is the HTML image tag and strFinal is the location of the file.)

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: b_bonnett
Date Posted: 23 August 2003 at 5:41pm

Or, like Michael suggested, you could use Replace:

strImg = Replace(strImg, "<img src=""", "")
strImg = Replace(strImg, """>", "")

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: pmormr
Date Posted: 23 August 2003 at 6:28pm
excellent, that's exactly what i wanted... thanks!

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net