title: Why does String.toDouble() ignores spaces, but String.toInt() not (in Kotlin)?
body: <p>Example:</p>
  <pre><code>val double = &quot;   6  &quot;.toDouble()
  val int = &quot;   6  &quot;.toInt()
  </code></pre>
  <p>The second declaration causes the following Exception:</p>
  <pre><code>Exception in thread &quot;main&quot; java.lang.NumberFormatException: For input string: &quot;   6  &quot;
  at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:67)
  at java.base/java.lang.Integer.parseInt(Integer.java:654)
  at java.base/java.lang.Integer.parseInt(Integer.java:786)
  at MainKt.main(Main.kt:9)
  </code></pre>
  <p>Are there any reasons why they didn't decide to either allow Strings to contain spaces or not for every type of number?</p>