Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > J2EE
|
J2EE General J2EE (Java 2 Enterprise Edition) discussions. Questions not specific to EE will be redirected elsewhere.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the J2EE section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2005, 08:53 AM
Registered User
 
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default array conversion

I am having a string like this
String abc = "{10,20}, {11,98}, {56,89}";

now i want to convert it to double dimensional array.
The elements may increase.
please help me.

 
Old May 23rd, 2005, 07:42 AM
Authorized User
 
Join Date: Jul 2004
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default

store the pairs as arrays by all means, but if you are going to be changing the size of the overall array then you should definitely use a java.util.Vector.

In fact I'd use a vector for most arrays other than very simple ones.

Also remember that from java 1.4 you can use the split function to split a string into an array i.e. CSV to array:

String[] sCSVItems = "1,2,3".split(",");

Hopefully that's helpful






Similar Threads
Thread Thread Starter Forum Replies Last Post
Convering a String Array to an Integer array nkrust C# 9 November 17th, 2010 12:02 PM
Go from 2d Array to 1d array without defining type OneQuestion General .NET 1 January 10th, 2008 11:13 AM
error when sorting an Array of Array nancy VBScript 2 February 17th, 2005 12:57 PM
Assigning value to array within array janise Beginning VB 6 23 January 11th, 2005 11:38 AM
Passing php array values to javascript array gkrishna Pro PHP 0 November 6th, 2004 03:20 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.