About 1,350,000 results
Open links in new tab
  1. How to convert string to Title Case in Python? - Stack Overflow

    Aug 23, 2024 · One possible solution would be to use Laurence's answer with the regex r"['\w]+" so apostrophes wouldn't end a match (additional punctuation could be added as needed). For the record, a neater way to do the last CamelCase example is as 'make IT camel CaSe'.title().replace(' ', '').

  2. How to Convert a String to Title Case Correctly in Python

    In this tutorial, you'll learn how to convert a string to title case in Python using the title() method or a helper function titlecase().

  3. Convert string to title case in Python - GeeksforGeeks

    Jan 7, 2025 · title() method in Python is a simple way to convert a string to a title case, where the first letter of each word is capitalized and all other letters are lowercase. Let's understand with the help of an example: [GFGTABS] Python a = "hello geek" # Converts string to title case b = a.title

  4. Python String Title method - GeeksforGeeks

    Jan 2, 2025 · title() method in Python is a simple way to convert a string to a title case, where the first letter of each word is capitalized and all other letters are lowercase. Let’s understand with the help of an example:

  5. python - Titlecasing a string with exceptions - Stack Overflow

    Sep 16, 2010 · Stuart Colville has made a Python port of a Perl script written by John Gruber to convert strings into title case but avoids capitalizing small words based on rules from the New York Times Manual of style, as well as catering for several special cases.

  6. Convert a String to Title Case in Python with str.title() - datagy

    Dec 14, 2022 · To convert a string to title case in Python, you can use the str.title() method, which will capitalize each word in a string. Because strings are immutable, the old string is destroyed and a new string is returned.

  7. Convert a String to Title Case Using Python

    Apr 9, 2022 · Convert a string to title in Python with the built-in Python function or with our improved version using a regex, with sample code.

  8. How can you convert a string to title case in Python?

    Python's str class includes a method called title(), which can convert a string to title case effortlessly. This method capitalizes the first letter of each word in the string and changes the remaining letters to lowercase.

  9. Converting String to Title Case in Python 3 - DNMTechs

    Jun 18, 2024 · In this article, we explored different methods to convert a string to title case in Python 3. We learned how to use the title() and capitalize() methods, as well as how to use the split() and join() methods in conjunction with list comprehensions.

  10. Python String title () method - AskPython

    Feb 27, 2020 · Python String title() method basically converts the input string to title case i.e. it converts only the first character of every word in the input string to Uppercase and converts the rest of the characters to Lowercase.

  11. Some results have been removed
Refresh