String Character Length: Difference between revisions
Content deleted Content added
This is not the place to talk about __len__, and there is no need to link to the byte length from each language section |
Handling encoded strings |
||
Line 299:
'''Interpreter:''' [[Python]] 2.4
<pre>
>>> len('ascii')
5
>>> len(u'\u05d0') # the letter Alef as unicode literal
1
>>> len('\xd7\x90'.decode('utf-8')) # Same encoded as utf-8 string
1
</pre>
==[[Ruby]]==
|