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

    Does anyone know of a really simple way of capitalizing just the first letter of a string, regardless of the capitalization of the rest of the string? For example: asimpletest -> Asimpletest

  2. python - How can I capitalize the first letter of each word in a string ...

    From the Python documentation on capwords: Split the argument into words using str.split (), capitalize each word using str.capitalize (), and join the capitalized words using str.join ().

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

    Apr 7, 2013 · 15 I tried this: Capitalize a string. Can anybody provide a simple script/snippet for guideline? Python documentation has capitalize() function which makes first letter capital. I want …

  4. python - How to capitalize the first letter of every sentence? - Stack ...

    Apr 2, 2014 · list.remove('') for w in list: stripper= w.strip().capitalize() +"." print stripper, What this code does is that it take an input as a string and convert it to string array using the split() function. And …

  5. 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 low...

  6. 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

  7. How to convert string to Title Case in Python? - Stack Overflow

    Aug 23, 2024 · From code wars - Write simple .camelCase method in Python for strings. All words must have their first letter capitalized without spaces. camelcase ("hello case") => HelloCase camelcase …

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

    How can I convert a string into uppercase in Python? When I tried to research the problem, I found something about string.ascii_uppercase, but it couldn't solve the problem: >>> s = 'sdsd'...

  9. python - How to capitalize 1st and 4th characters of a string? - Stack ...

    2 OLD MACDONALD: Write a function that capitalizes the first and fourth letters of a name I'm trying to write this in different ways and I also feel like there's an easier way to do this. Cant, you directly apply …

  10. .capitalize () doesn't work in Python in this case

    Sep 22, 2021 · .capitalize () doesn't work in Python in this case Asked 4 years, 2 months ago Modified 4 years, 2 months ago Viewed 2k times