Steven Matthews
Steven Matthews

Reputation: 11285

Trying to combine this list of unicode strings

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 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']

Upvotes: 2

Views: 3018

Answers (3)

Shashi
Shashi

Reputation: 2175

May be this help same one but with replace

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

Upvotes: 0

Cat Plus Plus
Cat Plus Plus

Reputation: 129764

Use unicode.join.

u''.join(that_list)

Upvotes: 9

Karl Knechtel
Karl Knechtel

Reputation: 61526

I've tried both using sum as well as using join. No luck.

?

''.join(the_list) works fine for me.

Upvotes: 1

Related Questions