We usually get the length of a string by
length method. But it is not the correct result of the string which composites of chinese charaters because the chinese charaters will take 2 space for each. On the other side, one more method
String, will return the
3, the bytes length of the string.
So, I define a function to get the result I want:
and make it as a monkey patch of
String with the path of