Created
March 28, 2015 08:12
-
-
Save rbtnn/cfb0d80c64335842a62d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! s:hoge(str, n) abort | |
let begin = len(a:str) % a:n | |
return (begin is 0 ? [] : [a:str[:begin-1]]) + split(a:str[(begin):], repeat('.', a:n) . '\zs') | |
endfunction | |
echo s:hoge('1234', 3) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment