2011-07-31 14 views
2

试图结合这个unicode字符串列表。我已经尝试使用总和以及使用连接。没有运气。试图结合这个unicode字符串列表

任何想法我可以做到这一点?我只想将所有这些字符串的纯文本输出作为一个大字符串。

[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'] 
+0

出了什么问题' ''。加入(my_list)'? – JBernardo

+0

'''.join(my_list)'也适用于我,但是,是的,我想正确的方法应该是'u''join(my_list)',正如Cat Plus Plus所说的那样。 – redShadow

+0

你得到安德鲁什么错误? – BrainStorm

回答

9

使用unicode.join。

u''.join(that_list) 
1

我使用金额以及使用加入用尽全力。没有运气。

''.join(the_list)适合我。

0

可能是这样的帮助同一个,但将其替换

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