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?
There are three kinds of actuaries: those who can count, and those who can't.
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
You got style baby! More than this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
|