About 1,340,000 results
Open links in new tab
  1. Checking whether a string starts with XXXX - Stack Overflow

    Jan 10, 2012 · I would like to know how to check whether a string starts with "hello" in Python. In Bash I usually do:

  2. string - How does python startswith work? - Stack Overflow

    >>> "hello".startswith("") True The documentation states: Return True if string starts with the prefix, otherwise return False. prefix can also be a tuple of prefixes to look for. So how does …

  3. Case-insensitive string startswith in Python - Stack Overflow

    Nov 27, 2012 · Case-insensitive string startswith in Python Asked 13 years, 1 month ago Modified 5 years, 5 months ago Viewed 78k times

  4. python - How does str.startswith really work? - Stack Overflow

    Jul 15, 2017 · 22 This has already been suggested on Python-ideas a couple of years back see: str.startswith taking any iterator instead of just tuple and GvR had this to say: The current …

  5. Python startswith() for loop and if statement - Stack Overflow

    Python startswith () for loop and if statement Asked 9 years, 11 months ago Modified 9 years, 11 months ago Viewed 29k times

  6. python - How to use str.startswith with multiple strings ... - Stack ...

    May 28, 2021 · From the Python documentation for str.startswith(prefix[, start[, end]]), I've added emphasis: Return True if string starts with the prefix, otherwise return False. prefix can also be …

  7. python - str.startswith with a list of strings to test for - Stack …

    Dec 9, 2013 · 348 I'm trying to avoid using so many comparisons and simply use a list, but not sure how to use it with str.startswith:

  8. Python: startswith any alpha character - Stack Overflow

    Mar 7, 2010 · How can I use the startswith function to match any alpha character [a-zA-Z]. For example I would like to do this: if line.startswith(ALPHA): Do Something

  9. python - Check if string starts with any of two (sub) strings - Stack ...

    Nov 16, 2022 · 8 str.startswith can take a tuple of strings as an argument. It will return true if the string starts with any of them.

  10. python - How to do a case-insensitive string.startswith - Stack …

    Apr 1, 2023 · How to do a case-insensitive string.startswith Asked 2 years, 9 months ago Modified 2 years, 9 months ago Viewed 3k times