String to Integer


/ Published in: Groovy
Save to your folder(s)

Print each char of an UTF-8 string as an Integer


Copy this code and paste it in your HTML
  1. // UTF-8 chars are represented with as much as 4 Integers
  2. String s= "aeiouáéíóú"
  3.  
  4. s.each{
  5. def value= it.toCharacter() as Integer
  6. println value
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.