I have an error when trying to use contain in python.
s = u"some utf8 words"
k = u"one utf8 word"
if s.contains(k):
print "contains"
How do i achieve the same result?
Example with normal ASCII string
s = "haha i am going home"
k = "haha"
if s.contains(k):
print "contains"
I am using python 2.7.x
u'...'
objects are not UTF-8 words. They are Unicode objects, while UTF-8 is encoded data representing Unicode values. It is comparable to displaying an image on the screen and encoding it into a PNG or JPEG file, or adatetime
object and encoding such objects to a ISO-8601 string. The encoded data and the value are related, but not the same thing.