You are viewing a single comment's thread. Return to all comments →
def count_multibyte_char(s) s.chars.filter{ |char| char.each_byte.size > 1 }.count end
Seems like cookies are disabled on this browser, please enable them to open this website
Ruby - Strings - Iteration
You are viewing a single comment's thread. Return to all comments →
def count_multibyte_char(s) s.chars.filter{ |char| char.each_byte.size > 1 }.count end