按長度切割字串 === ```python= import re string = '123456789abcdefg' re.findall(r'.{3}', string) ``` ``` ['123', '456', '789', 'abc', 'def'] ``` ## Ref. [python 按照固定长度分割字符串的方法小结]([https://](https://www.nhooo.com/note/qagi8h.html)) ###### tags: `語法相關`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up