title: Write a method that returns the even indexes of a string
body: <p>So I'm supposed to write a method that only prints out the even indexes of a string. So for instance if I input <strong>“Hiejlzl3ow”</strong> into the console/scanner I would want to return <strong>"Hello"</strong>. I got the solution by using a for loop and charAt(i), however I am having trouble returning the result as a String (as it is a char). I tried converting the charAt(i) using String.valueOf but it only prints out the first (or rather the 0) index value (in this case <strong>H</strong>). Does anyone have a quick fix for this? And is there a simpler solution? (Note: This is beginning java so only methods, for loops, string methods, and scanners are allowed.)</p>
  
  <pre><code>//This method prints out the even indexes of a string
  public static String decrypt(String question, Scanner console)
  {
    System.out.print(question + " ");
    String s = console.nextLine();
    for (int i = 1; i &lt; s.length()-1; i=i+2)
    {
       char x = (s.charAt(i));
       s = String.valueOf(x);
  
    }
  return s;
  }
  </code></pre>