Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
curtisq
Posts: 5
Registered: ‎06-19-2012
My Device: developer

Re: Converting a String into an array of ints

So after a few hours trying to understand the code and changing lines here and there it looks like I've finally got it to do what I want. I edited StringToInteger to return type int[]. The for loop at the end now looks like

for(int i=0;i<temp.length;i++)
		{
			ints[i] = Integer.parseInt(temp[i]); 
		}
		return ints;

 And now I have an array of ints directly from that function no conversion needed. I tested to see if it works by printing the array out in a textfield and it works. My only problem now is I've declared an array of static size but Im sure fixing that wont be a problem. Right now it works.

Thank you to everyone who posted in this thread it all helped me a bunch.

Please use plain text.