to_lower_case

2022-12-14 浏览 (1045)

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

  • 所属分类: 后端技术
  • 本文标签: 技术
  • 版权声明: 本文链接 https://seaxiang.com/blog/1b00538c2ae74e099693777bf0721963