Skip to content

Instantly share code, notes, and snippets.

@U-MA
Created September 5, 2015 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save U-MA/e690a0d4d39aef7e0a4c to your computer and use it in GitHub Desktop.
Save U-MA/e690a0d4d39aef7e0a4c to your computer and use it in GitHub Desktop.
条件に一致する要素の個数を返す関数
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