The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> How to parse line
denmarks
post Aug 5 2012, 11:10 AM
Post #1


Advanced Member
****

Group: Members
Posts: 104
Joined: 17-January 08
Member No.: 4,734



Let say I have the following line. The URLs will change.

<a class="member" href="#picture"><img src="HawaiiPhotos2012/members/vidter-s.jpg"><span><img src="HawaiiPhotos2012/members/vidter.jpg"></span></a>

How would a set a variable to only contain the URL in the first "src" statement?
The entire statement is already in a variable that I will call "theText".
The new variable that I will call "theURL" will equal "HawaiiPhotos2012/members/vidter-s.jpg". It would be nice to keep the quotes but I can always put them back if necessary.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Aug 5 2012, 11:57 AM
Post #2


.
********

Group: WDG Moderators
Posts: 4,770
Joined: 10-August 06
Member No.: 7



Depends on from where you got the theText variable from in the first place. Is it a string you've created manually, or is it part of the page's markup?
User is online!PM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
denmarks
post Aug 5 2012, 12:20 PM
Post #3


Advanced Member
****

Group: Members
Posts: 104
Joined: 17-January 08
Member No.: 4,734



Problem solved. Thanks anyway.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd May 2013 - 11:33 AM