About 444,000 results
Open links in new tab
  1. python - how to find whether a string is contained in another …

    str.find() and str.index() are nearly identical. the biggest difference is that when a string is not found, str.index() throws an error, like the one you got, while str.find() returns -1 as others' …

  2. How to find all occurrences of a substring? - Stack Overflow

    Follow-up: How to find all occurrences of a substring in a string while ignore some characters in Python?

  3. Check if a word is in a string in Python - Stack Overflow

    I'm working with Python, and I'm trying to find out if you can tell if a word is in a string. I have found some information about identifying if the word is in the string - using .find, but is ther...

  4. Examples for string find in Python - Stack Overflow

    Jul 7, 2013 · 0 if x is a string and you search for y which also a string their is two cases : case 1: y is exist in x so x.find (y) = the index (the position) of the y in x . case 2: y is not exist so x.find …

  5. string - How to get the position of a character in Python ... - Stack ...

    Feb 19, 2010 · For example in a string sentence, position of e is 1, 4, 7 (because indexing usually starts from zero). but what I find is both of the functions find() and index() returns first position …

  6. python - How to search for a string in text files? - Stack Overflow

    How to search for a string in text files? Asked 14 years, 8 months ago Modified 1 year, 10 months ago Viewed 1.1m times

  7. How do I check for an exact word or phrase in a string in Python

    I need to find a way to figure out a way to find the exact word in a string. All the information I have read online has only given me how to search for letters in a string, so 98787This is correct ...

  8. Search for String in all Pandas DataFrame columns and filter

    Oct 29, 2014 · Thought this would be straight forward but had some trouble tracking down an elegant way to search all columns in a dataframe at same time for a partial string match. …

  9. python - Filter pandas DataFrame by substring criteria - Stack …

    I have a pandas DataFrame with a column of string values. I need to select rows based on partial string matches. Something like this idiom: re.search(pattern, cell_in_question) returning a …

  10. python - Find string between two substrings - Stack Overflow

    Jul 30, 2010 · These solutions assume the start string and final string are different. Here is a solution I use for an entire file when the initial and final indicators are the same, assuming the …