MCPcopy
hub / github.com/attardi/wikiextractor / ucfirst

Function ucfirst

wikiextractor/extract.py:1512–1522  ·  view source on GitHub ↗

:return: a string with just its first character uppercase We can't use title() since it coverts all words.

(string)

Source from the content-addressed store, hash-verified

1510
1511
1512def ucfirst(string):
1513 """:return: a string with just its first character uppercase
1514 We can't use title() since it coverts all words.
1515 """
1516 if string:
1517 if len(string) > 1:
1518 return string[0].upper() + string[1:]
1519 else:
1520 return string.upper()
1521 else:
1522 return ''
1523
1524
1525def lcfirst(string):

Callers 4

normalizeTitleFunction · 0.85
normalizeNamespaceFunction · 0.85
extract.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected