我想通过引用它的标记来分割文档。我看到(here)他们能够通过在引号的开头添加'\'来伪造这个答案,但是在我的文档中有数百个这些字符串我正试图剪掉字符串因此,手动改变将是一个真正的痛苦和时间接受者。
以下是我试图剪切的字符串示例:
<a href="http://www.awin1.com/awclick.php?mid=2194&id=1548" target="_blank">D</a>
这是我当前代码的一个例子:
private function onShopTextLoaded(e:Event):void
{
shopArrayOfWebsites = e.target.data.split(/\n/);
for (var i:String in shopArrayOfWebsites)
{
trace("shopArrayOriginal: " + shopArrayOfWebsites[i]);
var arrayString:String = shopArrayOfWebsites[i].split('"' /* << that won't work */ );
trace(arrayString[1]);
//shopArrayOfWebsites[i] = arrayString[1];
}
}
private function postInShopView():void
{
var iLevel:Number = 1;
var iSection:Number = 1;
var iShop:Number = 0;
for (var i:String in shopArrayOfWebsites)
{
iShop++;
if(iShop >= 5)
{
iSection++;
iShop = 0;
}
if(iSection >= 5)
{
iLevel++;
iSection = 1;
}
var shopStringEquiv:String = "L" + iLevel.toString() + "S" + iSection.toString() + "Shop" + iShop.toString();
if(global.shopTarget == shopStringEquiv)
{
var result:uint = ExternalInterface.call("showShopFrame", shopArrayOfWebsites[i]);
}
//trace(shopStringEquiv);
//trace(shopArrayOfWebsites[i]);
}
}
我收到错误:
ReferenceError: Error #1069: Property 1 not found on String and there is no default value.
所以从这里开始我不太清楚我怎么能分开这份文件。有任何想法吗?谢谢!