mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	doc: Link to string.capwords from str.title (GH-20913)
				
					
				
			Since `title()` mentions its own short-comings, it should also mention the library function which does not possess them.
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit b786d9ec52)
Co-authored-by: Eric Wieser <wieser.eric@gmail.com>
			
			
This commit is contained in:
		
							parent
							
								
									ea6dc5ec08
								
							
						
					
					
						commit
						85f0792b8f
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -2118,7 +2118,11 @@ expression support in the :mod:`re` module).
 | 
			
		|||
        >>> "they're bill's friends from the UK".title()
 | 
			
		||||
        "They'Re Bill'S Friends From The Uk"
 | 
			
		||||
 | 
			
		||||
   A workaround for apostrophes can be constructed using regular expressions::
 | 
			
		||||
   The :func:`string.capwords` function does not have this problem, as it
 | 
			
		||||
   splits words on spaces only.
 | 
			
		||||
 | 
			
		||||
   Alternatively, a workaround for apostrophes can be constructed using regular
 | 
			
		||||
   expressions::
 | 
			
		||||
 | 
			
		||||
        >>> import re
 | 
			
		||||
        >>> def titlecase(s):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue