Campbell Ritchie wrote:You can treat each of the elements as a one‑letter String and convert that letter to a char, which gives you its Unicode value (not ASCII strictly). But this approach is dependent on the elements of the array having a particular type; even using a String would be horribly error‑prone.
Carey Brown wrote:I think we need more background on what it is that you're actually trying to achieve, perhaps with an example. What kinds of objects do you anticipate that your Object will hold?
Thanks, I can look into this.
Campbell Ritchie wrote:maybe the quickest way to turn it into an int is with the promotion operator.
No I was not aware, thanks so much, that's a good point, I wasn't thinking about before.
Campbell Ritchie wrote:Are you aware of the Character#getNumericValue() method?
Campbell Ritchie wrote:If you are reading from a text file, I am not sure I would use an array in the first place.
Mike Simmons wrote:I suspect it would be helpful to find out what class is in that array:
Mike Simmons wrote:
Piet Souris wrote: You can also do (if it is a joinery dataframe)
Mike Simmons wrote:I think you need to count the parentheses carefully in the mapToInt() line - you have one more '(' than ')'.
Paul Clapham wrote:Should be