each_codepoint

str.each_codepoint {|integer| block } â str
str.each_codepoint â an_enumerator
Instance Public methods

Passes the Integer ordinal of each character in str, also known as a codepoint when applied to Unicode strings to the given block.

If no block is given, an enumerator is returned instead.

"hello\u0639".each_codepoint {|c| print c, ' ' }

produces:

104 101 108 108 111 1593
doc_ruby_on_rails
2015-05-15 15:59:32
Comments
Leave a Comment

Please login to continue.