Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

Ruby | Integer | chr

概要

Integer#chr

詳細

文字コードから1文字を取得します

サンプルコード
# encoding: utf-8
require 'tbpgr_utils'

bulk_puts_eval binding, <<-EOS
65.chr
97.chr
EOS
__END__
下記はTbpgrUtils gemの機能
bulk_puts_eval

https://rubygems.org/gems/tbpgr_utils
https://github.com/tbpgr/tbpgr_utils
出力
65.chr # => "A"
97.chr # => "a"