试图结合这个unicode字符串列表

时间:2011-07-31 21:56:56

标签: python string unicode

尝试组合此unicode字符串列表。我尝试过使用sum和使用join。没有运气。

知道我怎么能这样做吗?我只想将所有这些字符串的纯文本输出作为一个大字符串。

[u'\nPanera Bread (NASDAQ: <a class="ticker" href="/stock/pnra#NASDAQ">PNRA</a>) is down 6 percent today over expectations of food inflation of 4.5% in Q3 and 5% for Q4. In addition, Panera Will Raise Menu Prices in Q4.',
 u'\nPNRA recently posted second quarter 2011 earnings of $1.18 per share. Reported earnings also outpaced the prior-year quarter earnings of 85 cents per share. ',
 u"\nBut shares were also lower ahead of the opening bell after the company reported weaker-than-expected same-store sales figures for its recent quarter late Tuesday. Its profit of $1.18 a share topped analysts' consensus call by a penny.",
 u'\nFor the twenty-six weeks ended June 28, 2011, net income was $68 million, or $2.27 per diluted share. These results compare to net income of $53 million, or $1.67 per diluted share, for the twenty-six weeks ended June 29, 2010, and represent a 36% year-over-year increase in diluted earnings per share.\n']

3 个答案:

答案 0 :(得分:9)

使用unicode.join。

u''.join(that_list)

答案 1 :(得分:1)

  

我尝试过使用sum和使用join。没有运气。

''.join(the_list)对我来说很好。

答案 2 :(得分:0)

可能是同样的帮助,但有替换

''.join(ur_list).replace('\n','')