【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;
转载请注明出处: http://www.cnblogs.com/liyuxia713/