Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Changing a string
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Changing a string

 Post Reply Post Reply
Author
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post 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!

Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2003 at 5:30pm
using asp, so theres no confusion...
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.

Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post 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, The Plane Gallery
Greetings From Christchurch
Back to Top
b_bonnett View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Location: New Zealand
Status: Offline
Points: 275
Post Options Post Options   Thanks (0) Thanks(0)   Quote b_bonnett Quote  Post ReplyReply Direct Link To This Post 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, The Plane Gallery
Greetings From Christchurch
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 23 August 2003 at 6:28pm
excellent, that's exactly what i wanted... thanks!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.