20 Dec
2011
20 Dec
'11
4:40 a.m.
On 12/18/2011 9:24 PM, Nathan Rice wrote:
Another bad example, since that's just a really verbose way of writing my_string.capitalize().
The python interpreter says otherwise...
foo = "line 1\nline 2\nline 3" foo.capitalize() 'Line 1\nline 2\nline 3' "\n".join(s.capitalize() for s in foo.split("\n")) 'Line 1\nLine 2\nLine 3'
Using the right method (as Nick corrected himself):
foo.title() 'Line 1\nLine 2\nLine 3'
-- Terry Jan Reedy