# Re: multi dim array?

**URL:** <https://www.ruby-forum.com/t/re-multi-dim-array/73068>\
**Category:** Ruby\
**Created:** [October 21, 2006, 12:19am UTC](https://www.ruby-forum.com/t/re-multi-dim-array/73068 "2006-10-21T00:19:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![phrogz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/2acd7d/32.png) [@phrogz](https://www.ruby-forum.com/u/phrogz)\
**Post date:** [October 21, 2006, 12:19am UTC](https://www.ruby-forum.com/t/re-multi-dim-array/73068/1 "2006-10-21T00:19:49Z")

</div>

From: Gijs N.

> def translate\_to\_braille(msg)

I think you want the String#tr method. It replaces each character in a  
source string with its corresponding character in a replacment string:

normal\_alphabet = “abcdefghijklmnopqrstuvwxyz”  
rot13\_alphabet = “nopqrstuvwxyzabcdefghijklm”

msg = “hello world!”  
puts msg.tr( normal\_alphabet, rot13\_alphabet)  
#=\> uryyb jbeyq!
