title: How to convert char to ascii value in kotlin language
body: <p>I am developing an android application with <code>kotlin</code> in which I need to convert an string character to its <code>ASCII</code> value,</p>
  
  <pre><code>fun tryDiCript(cypher: String) :String {
          var cypher = "fs2543i435u@$#g#@#sagb@!#12416@@@"
          var originalText = ""
  
          var regEx =Regex("[a-z]")
          for(char in  regEx.findAll(cypher))
          {                 
              originalText += (char.value.toInt()).toString()            
          }
         return originalText
  }
  </code></pre>
  
  <p><a href="https://www.programiz.com/kotlin-programming/examples/ascii-value-character" rel="noreferrer"> this tutorial website</a> showed me to use <code>char.toInt()</code> but it gives runtime error saying </p>
  
  <blockquote>
    <p>Caused by: java.lang.NumberFormatException: Invalid int: "u"</p>
  </blockquote>
  
  <p>so how if anyone knows hot to convert char to ASCII value please help me.</p>