You are viewing a single comment's thread. Return to all comments →
def count_multibyte_char(string) string. each_char. count { |char| char.each_byte.count > 1 } 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(string) string. each_char. count { |char| char.each_byte.count > 1 } end