title: how to replace characters in a string with integers?
body: <p>Say I have the the string: " aab + bab = b " and I want to </p>
  
  <ul>
  <li>replace all the <code>a</code> characters with the integer 0,  </li>
  <li>replace all the <code>b</code> characters with the integer 1</li>
  </ul>
  
  <p>so it will become:</p>
  
  <pre><code>001 + 101 = 1
  </code></pre>
  
  <p>what would be the easiest way to do this? </p>
  
  <p>so far I parced the equation into three parts:</p>
  
  <pre><code>System.out.println("Enter an Equation of variables");
  _inString = _in.nextLine();
  
      //find the three different parts of the equation
      String _noSpaces = _inString.replaceAll("\\s+","");
      String delims = "[+,=]";
      String[] _tokens = _noSpaces.split(delims);
  </code></pre>