String Character Length: Difference between revisions
Content deleted Content added
m Switch to header template |
|||
Line 260: | Line 260: | ||
'''Interpreter:''' [[Python]] 2.4 |
'''Interpreter:''' [[Python]] 2.4 |
||
len() returns the |
len() returns the number of characters in a unicode string or plain ascii string. To get the length of encoded string, you have to decode it first: |
||
<pre> |
<pre> |
||
>>> len('ascii') |
>>> len('ascii') |