Created
September 5, 2015 12:31
-
-
Save U-MA/e690a0d4d39aef7e0a4c to your computer and use it in GitHub Desktop.
条件に一致する要素の個数を返す関数
This file contains 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:count_if(list, string) abort | |
let copy = deepcopy(a:list) | |
call filter(copy, a:string) | |
return len(copy) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment