Return a copy of the string with leading characters removed. The chars
argument is a string specifying the set of characters to be removed.
If omitted or None, the chars argument defaults to removing
whitespace. The chars argument is not a prefix; rather, all
combinations of its values are stripped:
如果您真的需要使用
.lstrip()
,您可以将其作为函数重新实现:但是您需要知道})从前面剥离字符集,而不是前缀。来自(cpython)文档:
.lstrip()
(和.rstrip()
和{相关问题 更多 >
编程相关推荐