【python】 字符串转小写(含汉字等时仍work)

def mylower(str):
        outstr = "";
        strlen = len(str);
        idx = 0;
        while idx < strlen:
                if ord(str[idx])>0 and ord(str[idx])<= 128:
                        outstr += str[idx].lower();
                        idx += 1;
                else:
                        outstr += str[idx:idx+2];
                        idx += 2;

        return outstr;

  

原文地址:https://www.cnblogs.com/liyuxia713/p/3413103.html