René's URL Explorer Experiment


Title: Learn More Using String Methods (Video) – Real Python

Open Graph Title: Learn More Using String Methods – Real Python

Description: In this part of the course, you’ll learn more about a couple of Python string methods that you can use to learn more about the substring. I’ll start off by showing you a little table that gives you an overview about what’s the name of the string…

Open Graph Description: In this part of the course, you’ll learn more about a couple of Python string methods that you can use to learn more about the substring. I’ll start off by showing you a little table that gives you an overview about what’s the name of the string…

Opengraph URL: https://realpython.com/lessons/string-methods-python-substring/

X: @realpython

direct link

Domain: realpython.com


Hey, it has json ld scripts:
  {
    "@context": "https://schema.org",
    "@type": "VideoObject",
    "name": "Learn More Using String Methods",
    "description": "In this part of the course, you’ll learn more about a couple of Python string methods that you can use to learn more about the substring. I’ll start off by showing you a little table that gives you an overview about what’s the name of the string…",
    "thumbnailUrl": ["https://files.realpython.com/media/How-to-Check-if-a-String-Contains-Another-String_Watermarked.ad5138507ec7.jpg"],
    "uploadDate": "2023-04-04T14:00:00+00:00",
    "duration": "PT1M49S",
    
    "potentialAction": {
      "@type": "SeekToAction",
      "target": "https://realpython.com/lessons/string-methods-python-substring/#t={seek_to_second_number}",
      "startOffset-input": "required name=seek_to_second_number"
    }
  }
  

authorReal Python
twitter:cardsummary_large_image
twitter:imagehttps://files.realpython.com/media/How-to-Check-if-a-String-Contains-Another-String_Watermarked.ad5138507ec7.jpg
og:imagehttps://files.realpython.com/media/How-to-Check-if-a-String-Contains-Another-String_Watermarked.ad5138507ec7.jpg
twitter:creator@realpython
og:typevideo.episode

Links:

https://realpython.com/
Start Herehttps://realpython.com/start-here/
Learn Python https://realpython.com/lessons/string-methods-python-substring/
Python Tutorials →In-depth articles and video courseshttps://realpython.com/search?kind=article&kind=course&order=newest
Learning Paths →Guided study plans for accelerated learninghttps://realpython.com/learning-paths/
Quizzes & Exercises →Check your learning progresshttps://realpython.com/quizzes/
Browse Topics →Focus on a specific area or skill levelhttps://realpython.com/tutorials/all/
Community Chat →Learn with other Pythonistashttps://realpython.com/community/
Office Hours →Live Q&A calls with Python expertshttps://realpython.com/office-hours/
Podcast →Hear what’s new in the world of Pythonhttps://realpython.com/podcasts/rpp/
Books →Round out your knowledge and learn offlinehttps://realpython.com/products/books/
Reference →Concise definitions for common Python termshttps://realpython.com/ref/
Code Mentor →BetaPersonalized code assistance & learning toolshttps://realpython.com/mentor/
Unlock All Content →https://realpython.com/account/join/
More https://realpython.com/lessons/string-methods-python-substring/
Learner Storieshttps://realpython.com/learner-stories/
Python Newsletterhttps://realpython.com/newsletter/
Python Job Boardhttps://www.pythonjobshq.com
Meet the Teamhttps://realpython.com/team/
Become a Tutorial Writerhttps://realpython.com/write-for-us/
Become a Video Instructorhttps://realpython.com/become-an-instructor/
Searchhttps://realpython.com/search
https://realpython.com/search
Joinhttps://realpython.com/account/join/
Sign‑Inhttps://realpython.com/account/login/?next=%2Flessons%2Fstring-methods-python-substring%2F
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-string-contains-substring
Unlock This Lessonhttps://realpython.com/account/join/?utm_source=rp_lesson&utm_content=python-string-contains-substring
https://realpython.com/courses/python-string-contains-substring/#team
Check if a Python String Contains a Substringhttps://realpython.com/courses/python-string-contains-substring/
Martin Breusshttps://realpython.com/courses/python-string-contains-substring/#team
Recommended Tutorialhttps://realpython.com/python-string-contains-substring/
Course Slides (PDF)https://realpython.com/courses/python-string-contains-substring/downloads/python-string-contains-substring-slides/
Sample Code (ZIP)https://realpython.com/courses/python-string-contains-substring/downloads/python-string-contains-substring-code/
Ask a Questionhttps://realpython.com/lessons/string-methods-python-substring/#discussion
https://realpython.com/feedback/survey/course/python-string-contains-substring/liked/?from=lesson-title
https://realpython.com/feedback/survey/course/python-string-contains-substring/disliked/?from=lesson-title
Transcripthttps://realpython.com/lessons/string-methods-python-substring/#transcript
Discussionhttps://realpython.com/lessons/string-methods-python-substring/#discussion
00:00https://realpython.com/lessons/string-methods-python-substring/#t=0.56
In this part of the course,https://realpython.com/lessons/string-methods-python-substring/#t=0.56
you’ll learn more about a couple of Python string methods that you can use tohttps://realpython.com/lessons/string-methods-python-substring/#t=1.75
learn more about the substring.https://realpython.com/lessons/string-methods-python-substring/#t=6.15
I’ll start off by showing you a little table that gives you an overview abouthttps://realpython.com/lessons/string-methods-python-substring/#t=8.1
what’s the name of the string method, what happens if it does find a substring,https://realpython.com/lessons/string-methods-python-substring/#t=11.83
and what happens if it doesn’t find the substring. One that you’re going to look athttps://realpython.com/lessons/string-methods-python-substring/#t=15.99
is str.count(),https://realpython.com/lessons/string-methods-python-substring/#t=20.56
and this is a way to get a count of how often does a substring appear in ahttps://realpython.com/lessons/string-methods-python-substring/#t=22.33
string. So if it finds the substring,https://realpython.com/lessons/string-methods-python-substring/#t=26.79
it gives you back an integer that tells you how often it is found inside of thehttps://realpython.com/lessons/string-methods-python-substring/#t=29.55
string. And if it’s never found, then it returns the integer 0.https://realpython.com/lessons/string-methods-python-substring/#t=33.35
00:39https://realpython.com/lessons/string-methods-python-substring/#t=39.12
Then there’s str.index().https://realpython.com/lessons/string-methods-python-substring/#t=39.12
That’s a way for you to locate the substring in the string. And what it does,https://realpython.com/lessons/string-methods-python-substring/#t=40.73
it gives you back the start index of where the first occurrence of the substringhttps://realpython.com/lessons/string-methods-python-substring/#t=45.49
is found inside of the string that you’re searching in.https://realpython.com/lessons/string-methods-python-substring/#t=50.18
00:53https://realpython.com/lessons/string-methods-python-substring/#t=53.4
What it does when there is no substring in the string is to raise a ValueError.https://realpython.com/lessons/string-methods-python-substring/#t=53.4
00:59https://realpython.com/lessons/string-methods-python-substring/#t=59.52
And then there’s also str.find() that does the same thing as str.index()https://realpython.com/lessons/string-methods-python-substring/#t=59.52
in the success condition. So if it finds the substring,https://realpython.com/lessons/string-methods-python-substring/#t=63.99
then it gives you back the starting index position.https://realpython.com/lessons/string-methods-python-substring/#t=66.73
01:10https://realpython.com/lessons/string-methods-python-substring/#t=70.0
But if the substring isn’t found, then instead of raising a ValueError,https://realpython.com/lessons/string-methods-python-substring/#t=70.0
it returns -1.https://realpython.com/lessons/string-methods-python-substring/#t=73.79
I’ll tell you more about str.index() and str.find() throughout this course.https://realpython.com/lessons/string-methods-python-substring/#t=76.17
01:20https://realpython.com/lessons/string-methods-python-substring/#t=80.28
You may have seen str.find() used to check whether a substring is in thehttps://realpython.com/lessons/string-methods-python-substring/#t=80.28
string. I don’t consider this a good way to do it,https://realpython.com/lessons/string-methods-python-substring/#t=84.78
but I’ll show you how to do it later on in the course so that you also can maybehttps://realpython.com/lessons/string-methods-python-substring/#t=87.74
see for yourself how it works and why using the in operator is a better choice.https://realpython.com/lessons/string-methods-python-substring/#t=92.22
01:37https://realpython.com/lessons/string-methods-python-substring/#t=97.52
But all of these string methods have their use cases.https://realpython.com/lessons/string-methods-python-substring/#t=97.52
They are useful for learning more about the substring.https://realpython.com/lessons/string-methods-python-substring/#t=100.61
And now let’s head back over to the REPL to try them out and learn a little morehttps://realpython.com/lessons/string-methods-python-substring/#t=103.44
about your substring.https://realpython.com/lessons/string-methods-python-substring/#t=107.18
Become a Memberhttps://realpython.com/account/join/
https://realpython.com/videos/generalize-substring-check/
Overviewhttps://realpython.com/courses/python-string-contains-substring/
https://realpython.com/lessons/count-substring-python/
Check if a Python String Contains a Substring (Overview) 02:00 https://realpython.com/videos/python-string-contains-substring-overview/
Confirm the Presence of a Substring 04:31 https://realpython.com/videos/confirm-substring-python/
Generalize Your Substring Check 04:10 https://realpython.com/videos/generalize-substring-check/
Learn More Using String Methods 01:49 https://realpython.com/lessons/string-methods-python-substring/
Use .count() to Get the Number of Occurrences 02:30 https://realpython.com/lessons/count-substring-python/
Use .index() to Get the Location of the Substring 02:35 https://realpython.com/lessons/index-python-substring/
Avoid Using .find() to Check for Substrings 05:20 https://realpython.com/lessons/avoid-find-python-substring/
Get to Know Regex for Finding Substrings 01:32 https://realpython.com/lessons/substrings-regex-python-intro/
Match a Substring Using re.search() 03:51 https://realpython.com/lessons/substring-re-search-python/
Explore a Match Object 03:25 https://realpython.com/lessons/match-object-substring/
Find All Pattern Matches 03:28 https://realpython.com/lessons/find-pattern-matches-python/
Get All Matches as Match Objects 03:26 https://realpython.com/lessons/get-match-objects-python/
Wrap Up Finding Substrings With Regex 01:51 https://realpython.com/lessons/substrings-regex-python-summary/
Set Up and Inspect the Data 02:10 https://realpython.com/lessons/inspect-pandas-data/
Filter DataFrame Rows With .str.contains() 02:03 https://realpython.com/lessons/filter-dataframe-str-contains/
Use Regular Expressions With pandas 02:23 https://realpython.com/lessons/regular-expressions-pandas/
Check if a Python String Contains a Substring (Quiz) 11:00 https://realpython.com/lessons/python-string-contains-substring-quiz/
Check if a Python String Contains a Substring (Summary) 02:22 https://realpython.com/lessons/python-string-contains-substring-summary/
Privacy Policyhttps://realpython.com/privacy-policy/

Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover

Robots: max-image-preview:large


URLs of crawlers that visited me.