Re: String of numbers into to array of numbers
On Sep 22, 2:00 pm, Lew <l...@lewscanon.com> wrote:
Lew wrote:
Another way:
List <Integer> numbers = new ArrayList <Integer> ();
for ( String inVal : cStr.split( "[ ,]" ) )
{
try
{
Oops, meant:
numbers.add( Integer.valueOf( inVal ));
}
catch ( NumberFormatException exc )
{
System.err.println( "Not an integer: \"+ inVal +"\"" );
}
}
--
Lew
Hi Lew,
I never meant to have it be a perfect program, just a small inclusive
demo of one part of what I considered to be my problem.
Thanks for all you wrote.
The problem was not exactly what I demo'd but trying to get
a simple read of data from a textfield source. My demo was
off base. Further, I had a need to take the same data
and place it into a array similar to this...using program
code rather than copy/paste.
int[]c = {32,32,32,66,117,121,32,121,111,117,114,32,67,72,73,67,75,69,
78,83,32,97,116,32,68,65,86,69,39,83,32,70,65,82,77,32,32,32,32};
This is char data and so was data originally in the opening Q.
I am not there yet. The brackets {} are not an error.
It is a base64 problem, the main is what Roedy wrote in code
that I downloaded from his website.
I accept all your criticism, revisions. I hope to
keep your model in front of me and try to correct the error
of my ways when I ask for "help" in this forum.
bH