title: Unable to detect spaces or punctuation marks
body: <p>Code basically doubles something like abc123 to abc246. Now the problem here is that it won't detect spaces or punctuation marks and it'll give me an error for the line int i = Integer.parseInt(sentence);. Any ideas? Thanks</p>
  
  <p>Edit: This code asks for a user input sentence through Scanner.</p>
  
  <pre><code>        else
          {
              String woah = sentence;
              sentence = sentence.replaceAll("\\D", "");
              int i = Integer.parseInt(sentence);
              int j = i * 2 ;
              woah = woah.replaceAll("" + i, "" + j);
              System.out.println(woah);
          }
  </code></pre>