You are viewing a single comment's thread. Return to all comments →
def count_multibyte_char(data) count = 0 data.each_char {|d| count +=1 if d.bytesize > 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(data) count = 0 data.each_char {|d| count +=1 if d.bytesize > 1} count
end