MCPcopy
hub / github.com/django/django / capfirst

Function capfirst

django/utils/text.py:26–32  ·  view source on GitHub ↗

Capitalize the first letter of a string.

(x)

Source from the content-addressed store, hash-verified

24
25@keep_lazy_text
26def capfirst(x):
27 """Capitalize the first letter of a string."""
28 if not x:
29 return x
30 if not isinstance(x, str):
31 x = str(x)
32 return x[0].upper() + x[1:]
33
34
35# Set up regular expressions

Callers 15

__init__Method · 0.90
handleMethod · 0.90
_get_input_messageMethod · 0.90
_validate_usernameMethod · 0.90
_build_app_dictMethod · 0.90
history_viewMethod · 0.90
format_callbackFunction · 0.90
date_hierarchyFunction · 0.90
__new__Method · 0.90
add_fieldsMethod · 0.90
date_error_messageMethod · 0.90

Calls

no outgoing calls

Tested by 1