Converts a string to title case, preserving the input as is >>> sentence_to_title_case("Aakash Giri") 'Aakash Giri' >>> sentence_to_title_case("aakash giri") 'Aakash Giri' >>> sentence_to_title_case("AAKASH GIRI") 'Aakash Giri' >>> sentence_to_title_c
(input_str: str)
| 32 | |
| 33 | |
| 34 | def sentence_to_title_case(input_str: str) -> str: |
| 35 | """ |
| 36 | Converts a string to title case, preserving the input as is |
| 37 | |
| 38 | >>> sentence_to_title_case("Aakash Giri") |
| 39 | 'Aakash Giri' |
| 40 | |
| 41 | >>> sentence_to_title_case("aakash giri") |
| 42 | 'Aakash Giri' |
| 43 | |
| 44 | >>> sentence_to_title_case("AAKASH GIRI") |
| 45 | 'Aakash Giri' |
| 46 | |
| 47 | >>> sentence_to_title_case("aAkAsH gIrI") |
| 48 | 'Aakash Giri' |
| 49 | """ |
| 50 | |
| 51 | return " ".join(to_title_case(word) for word in input_str.split()) |
| 52 | |
| 53 | |
| 54 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected