title: Is there any method in kotlin to get digit at specific index in an "Int"?
body: <p>I am making a Math quiz and want to perform Addition operation "with carrying". I want to get a digit at specific index but cannot find any method for it. I am currently doing it with convert Int into toString() but some times it doesn't gives correct value.
  My code:</p>
  
  <pre><code>fun main(args: Array&lt;String&gt;) {
    var a = (100..999).random()
      var b = (1..9).random().toString()    
      var temp = a.toString().get(2)    
      var temp1 = (temp+b)
      var length = temp1.toString().length 
  
      println(a)
      println(b)
      println("last index: "+temp)
      println("temp1: "+temp1)
      println("length: "+length)
  
  }
  </code></pre>
  
  <p>Output: </p>
  
  <pre><code>length is greater then 1
  a : 771
  b : 6
  last index : 1
  Addition : 16
  length : 2
  </code></pre>
  
  <p>You can see the result. When i add two digits it's doesn't gives the correct value. So is there any method to extract any digit at specific index.</p>