| Author |
Topic Search Topic Options
|
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Topic: Changing a string 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!
|
|
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2003 at 5:30pm |
|
using asp, so theres no confusion...
|
|
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
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.
|
|
|
 |
b_bonnett
Mod Builder Group
Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
|
Post Options
Thanks(0)
Quote Reply
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
|
|
|
 |
b_bonnett
Mod Builder Group
Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2003 at 5:41pm |
Or, like Michael suggested, you could use Replace:
strImg = Replace(strImg, "<img src=""", "") strImg = Replace(strImg, """>", "") |
Blair
|
|
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 August 2003 at 6:28pm |
|
excellent, that's exactly what i wanted... thanks!
|
|
|
 |