:return: a string with just its first character uppercase We can't use title() since it coverts all words.
(string)
| 1510 | |
| 1511 | |
| 1512 | def 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 | |
| 1525 | def lcfirst(string): |
no outgoing calls
no test coverage detected