Trying to combine this list of unicode strings. I've tried both using sum as well as using join. No luck.
Any idea how I can do this? I just want a plain text output of all of these strings as one large string.
[u'\nPanera Bread (NASDAQ: <a class="ticker" href="/stock/pnra#NASDAQ">PNRA</a>) is down 6 percent today over expe开发者_高级运维ctations 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']
Use unicode.join.
u''.join(that_list)
I've tried both using sum as well as using join. No luck.
?
''.join(the_list)
works fine for me.
May be this help same one but with replace
''.join(ur_list).replace('\n','')
精彩评论