We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Ruby
- Strings
- Ruby - Strings - Iteration
- Discussions
Ruby - Strings - Iteration
Ruby - Strings - Iteration
Sort by
recency
|
50 Discussions
|
Please Login in order to post a comment
I ended up with:
str.each_char.select {|ch| ch.each_byte.count > 1}.count
def count_multibyte_char(string) string. each_char. count { |char| char.each_byte.count > 1 } end
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.
def count_multibyte_char(data) count = 0 data.each_char {|d| count +=1 if d.bytesize > 1} count
end
If you are a coder, you know how important it is to have a sharp and focused mind. Coding requires a lot of mental energy, creativity, and problem-solving skills. But sometimes, you may feel tired, stressed, or overwhelmed by your projects. That’s why you may want to try salajeet, a natural substance that can boost your brain power and performance.