0
我有一個字符串如何從一個特定的字符串獲取子的一部分在python
str = <iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/jc8zayasOB8" frameborder="0" allowfullscreen></iframe>
,我想借此在子SRC - 即「https://www.youtube-nocookie.com/embed/jc8zayasOB8」。那麼我們如何才能做到這一點。 我試過這個
my_string="hello python world , i'm a beginner "
print my_string.split("world",1)[1] .
但它給了世界之後的所有字符串。我只想要src裏面的子字符串。
非常感謝親愛的朋友 – manuthalasseril