to_lower_case

  • 2022-12-14
  • 浏览 (780)

to_lower_case.py 源码

# 转换成小写字母

class Solution:

    def toLowerCase(self, str: str) -> str:
        res = ''
        for c in str:
            if 65 <= ord(c) <= 90:
                res += chr(ord(c) + 32)
            else:
                res += c
        return res

你可能感兴趣的文章

first_unique_char

implement_strstr

is_palindrome

0  赞