title: How to use Kotlin to find whether a string is numeric?
body: <p>I'd like to use a <code>when()</code> expression in Kotlin to return different values from a function. The input is a <code>String</code>, but it might be parsable to an <code>Int</code>, so I'd like to return the parsed <code>Int</code> if possible, or a <code>String</code> if it is not. Since the input is a <code>String</code>, I cannot use the is type check expression.</p>
  <p>Is there any idiomatic way to achieve that?</p>
  <p>My problem is what the <code>when()</code> expression should look like, not about the return type.</p>