- 用法:- str.removeprefix(prefix, /)
- 如果字符串以 - prefix字符串開頭,則返回- string[len(prefix):]。否則,返回原始字符串的副本:- >>> 'TestHook'.removeprefix('Test') 'Hook' >>> 'BaseTestCase'.removeprefix('Test') 'BaseTestCase'- 3.9 版中的新函數。 
相關用法
- Python str.removesuffix用法及代碼示例
- Python str.rstrip用法及代碼示例
- Python str.isidentifier用法及代碼示例
- Python str.expandtabs用法及代碼示例
- Python str.isupper用法及代碼示例
- Python str.title用法及代碼示例
- Python str.splitlines用法及代碼示例
- Python str.lstrip用法及代碼示例
- Python str.split用法及代碼示例
- Python str.zfill用法及代碼示例
- Python str.strip用法及代碼示例
- Python str.format_map用法及代碼示例
- Python str() vs repr()用法及代碼示例
- Python string轉integer用法及代碼示例
- Python string strip()用法及代碼示例
- Python string.octdigits用法及代碼示例
- Python string.whitespace用法及代碼示例
- Python strip()用法及代碼示例
- Python str()用法及代碼示例
- Python string capitalize()用法及代碼示例
注:本文由純淨天空篩選整理自python.org大神的英文原創作品 str.removeprefix。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
