Skip to content

Implement method CppStringT::title() #53

@schmouk

Description

@schmouk

"str.title()

Return a titlecased version of the string where words start with an uppercase character and the remaining characters are lowercase.

For example:
>>>

'Hello world'.title()
'Hello World'

The algorithm uses a simple language-independent definition of a word as groups of consecutive letters. The definition works in many contexts but it means that apostrophes in contractions and possessives form word boundaries, which may not be the desired result:

"they're bill's friends from the UK".title()
"They'Re Bill'S Friends From The Uk"

The string.capwords() function does not have this problem, as it splits words on spaces only."

Metadata

Metadata

Assignees

Labels

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions