Ruby - Strings - Iteration

Sort by

recency

|

51 Discussions

|

  • + 0 comments

    def count_multibyte_char(s) s.chars.filter{ |char| char.each_byte.size > 1 }.count end

  • + 1 comment

    I ended up with: str.each_char.select {|ch| ch.each_byte.count > 1}.count

  • + 0 comments

    def count_multibyte_char(string) string. each_char. count { |char| char.each_byte.count > 1 } end

  • + 1 comment

    I am typescript-react developer in a well-known organization in Pakistan. i am also handling two remote projects, one is from lahore based small e-commerce company's store and the other one is Karachi based e-commerce store SL Basics. As a developer it is too hard to take care of your eyes thats why i mostly use rose water.

  • + 0 comments

    def count_multibyte_char(data) count = 0 data.each_char {|d| count +=1 if d.bytesize > 1} count

    end