Everything I read suggests that the len() function can be used to find the length of a string.
This snippet fails and produces a length of 65535
str1 = " " # a single space
str1 = str1.strip()
print( len( str1 ) )
Any other string including an empty string “” gives the correct length. It looks like the strip() function is failing in strings consisting only of spaces.
Am I missing something here?