How about:

 

var pos:int = randomText.indexOf('.swf"');

var url:String = randomText.substring(0, pos + 4);

pos = url.lastIndexOf('"');

url = url.substring(pos + 1);

 

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of João
Sent: Tuesday, March 20, 2007 2:43 PM
To: [email protected]
Subject: [flexcoders] Using Flex to extract a phrase from a text file

 

I have one text file with about 100 lines of random text. Somewhere on
the file, there is an URL for a SWF. The url has the .swf word in it,
and it's between "'s . The format of the file can change over time,
and there is only one SWF file on the text file. 

I need to find the best algorithm to extract the URL from the text
file. Any suggestions?

Thanks, 

João Saleiro

 

Reply via email to