About 105,000 results
Open links in new tab
  1. Does Python have a string 'contains' substring method?

    Aug 9, 2010 · 571 Does Python have a string contains substring method? 99% of use cases will be covered using the keyword, in, which returns True or False:

  2. python - Why doesn't calling a string method (such as .replace or ...

    More broadly, this is true for all Python string methods that change a string's content, e.g. replace, strip, translate, lower / upper, join,... You must assign their output to something if you want to …

  3. string - What's the difference between str.isdigit (), isnumeric () …

    52 The Python documentation notes the difference between the three methods. str.isdigit Return true if all characters in the string are digits and there is at least one character, false otherwise. …

  4. python - String formatting: % vs. .format vs. f-string literal - Stack ...

    To answer your second question, string formatting happens at the same time as any other operation - when the string formatting expression is evaluated. And Python, not being a lazy …

  5. string - strip () vs lstrip () vs rstrip () in Python - Stack Overflow

    That is, the string provided as an argument is considered as a set of characters, not as a substring. lstrip and rstrip work the same way, except that lstrip only removes characters on …

  6. python - Remove all whitespace in a string - Stack Overflow

    Oct 1, 2016 · All string characters are unicode literal in Python 3; as a consequence, since str.split() splits on all white space characters, that means it splits on unicode white space …

  7. How to delete a character from a string using Python

    583 There is a string, for example. EXAMPLE. How can I remove the middle character, i.e., M from it? I don't need the code. I want to know: Do strings in Python end in any special …

  8. python - Count the number of occurrences of a character in a …

    How do I count the number of occurrences of a character in a string? e.g. 'a' appears in 'Mary had a little lamb' 4 times.

  9. How do I reverse a string in Python? - Stack Overflow

    There is no built in reverse method for Python's str object. How can I reverse a string?

  10. What is the most efficient string concatenation method in Python ...

    Is there an efficient mass string concatenation method in Python (like StringBuilder in C# or StringBuffer in Java)? I found following methods here: Simple concatenation using + Using a …