modify message using set of rules in java
<p>I have a message, for example <code>KU7</code>.
Also, I have a set of rules, like this:</p>

<pre><code>Q K S 7 J ... U 
R Y L B 8 ... W
</code></pre>

<p>and so on. I need to translate the message using this rules. There is ~20. Translated message will be <code>YWB</code>.</p>

<p><strong>What I have tried:</strong></p>

<p>To create a method that takes a <code>char</code> as and argument, method has a lot of <code>case blocks</code> (all rules) and returns translated <code>char</code>. Then using <code>for loop</code> I loop through the message and translate symbol by symbol.
But I think it is not good solution.</p>

<p>Can anybody provide me with other ideas / solutions / links to similar questions? </p>
