mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Move title() from utilities.utils to utilities.string
This commit is contained in:
10
netbox/utilities/string.py
Normal file
10
netbox/utilities/string.py
Normal file
@ -0,0 +1,10 @@
|
||||
__all__ = (
|
||||
'title',
|
||||
)
|
||||
|
||||
|
||||
def title(value):
|
||||
"""
|
||||
Improved implementation of str.title(); retains all existing uppercase letters.
|
||||
"""
|
||||
return ' '.join([w[0].upper() + w[1:] for w in str(value).split()])
|
Reference in New Issue
Block a user