code: public String format(String s)
      {
          for(int i = 0; i < s.length(); i++) {
              if(s.substring(i, i + 1).equals("*") && i > 0)
                  if(isOperand(s.substring(i - 1, i), var) && i < s.length() - 1 && s.substring(i + 1, i + 2).equals(var))
                      s = s.substring(0, i) + s.substring(i + 1);
          }
  
          return s;
      }
docs: Modifies the string to look more like it would if someone wrote the expression
  out on paper.
  @param s the mathematical expression.