About 60,300 results
Open links in new tab
  1. python - Capitalize a string - Stack Overflow

    May 29, 2016 · python capitalize() on a string starting with space. 3. Keeping existing capital letters in string. 27 ...

  2. python - How to change a string into uppercase? - Stack Overflow

    for making lowercase from uppercase string just use "string".lower() where "string" is your string that you want to convert lowercase. for this question concern it will like this: s.lower() If you …

  3. How to capitalize a string in Python? - Stack Overflow

    How can I convert a string to all capitals in Python 3.4? for example, I want to convert: string to: STRING I have tried with the .upper method, but it returns: "string".upper <built-in method

  4. How can I capitalize the first letter of each word in a string?

    import string string.capwords("they're bill's friends from the UK") >>>"They're Bill's Friends From The Uk" From the Python documentation on capwords: Split the argument into words using …

  5. Python How to capitalize nth letter of a string - Stack Overflow

    Apr 7, 2013 · I know it's an old topic but this might be useful to someone in the future: def myfunc(str, nth): new_str = '' #empty string to hold new modified string for i,l in enumerate(str): …

  6. python - How do you reverse/capitalize words in a string - Stack …

    Apr 29, 2017 · I need to write a python function which capitalizes every even word within a string sentence, and also reverses every odd word within that string. For example: aString = …

  7. Opposite to capitalize for Python strings - Stack Overflow

    If I want to make a string start with a capital letter, I do "hello world".capitalize() # produces 'Hello world' However, I would need the exact opposite: I need to make a string start with a …

  8. python - How do I capitalize input? - Stack Overflow

    Nov 23, 2015 · Python String Capitalize. 1. Code that changes the users input to lower case. 1. How to take any input ...

  9. Python function that capitalizes entire word - Stack Overflow

    May 27, 2020 · capitalize() is not an in-place operation. It doesn't modify the original string but instead it returns the capitalized version. You need to save this value in a variable. For …

  10. Capitalize the first letter of each word in a string in Python

    Feb 21, 2021 · You aren't assigning the result anywhere -- the split_phrase variable doesn't change at any point.. You could use str.title() as suggested by @pythonenthusiast, or use a …

Refresh