我有这个函数来第一次找到字符串:
var strng:String = new String(txtSource.text)
var position:Number = new Number();
position = strng.indexOf("<img pg",0);
strng = strng.substring(position + 4);
position = strng.indexOf(">");
strng = strng.substring(0, position);
textcontrol1.text = String(strng);
现在我得到以下字符串作为答案
<img pg="asStoryVid" class="" vspace="0" marginheight="0" marginwidth="0" width="300" border="0" src="http://www.abc.com/thumb/msid-22087805,width-300,resizemode-4/xyz.jpg"
alt="" title="" ag="">
现在,我只想要上面字符串中的 src="http://www.abc.com/thumb/msid-22087805,width-300,resizemode-4/xyz.jpg" 。为此我写了这个函数
var strng1:String = new String(textcontrol1.text)
var position1:Number = new Number();
position1 = strng1.indexOf('src="http://',0);
strng1 = strng1.substring(position1 + 0);
position1 = strng1.indexOf('"');
strng1 = strng1.substring(0, position1);
textcontrol1.text = String(strng1);
但是在输出中我得到一个无字符串任何人都可以告诉我我错在哪里?