On 20/06/07, Norman Khine <[EMAIL PROTECTED]> wrote:
> My question is how to get all the words in the string to start with
> capital letter?
Hmm, well the title() function is a new one to me :-)
More generally, if we have raw = 'one two three', then I would have
done it using raw.split(). i.e.
thanks, it is as easy as that ;)
Adam A. Zajac wrote:
> On Wed, 20 Jun 2007 12:32:53 +0200
>
> Norman Khine <[EMAIL PROTECTED]> wrote:
>
>> My question is how to get all the words in the string to start with
>> capital letter?
> title() should do it
>
a = "hello world"
a.title()
On Wed, 20 Jun 2007 12:32:53 +0200
Norman Khine <[EMAIL PROTECTED]> wrote:
> My question is how to get all the words in the string to start with
> capital letter?
title() should do it
>>>a = "hello world"
>>>a.title()
>>>'Hello World'
___
Tutor maillis
Hello,
I would like to capitalize each word from an input form.
The problem is that the input form can be added as:
"HELLO world"
"hello world"
"HELLO WORLD"
etc..
If I do this:
>>> string = "HELLO world"
>>> print string.capitalize()
Hello world
>>>
only the first word gets capitalized.
My