Results 1 to 4 of 4
Thread: storing a string in an array
- 08-08-2009, 02:13 PM #1
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
-
I have to admit that this confuses me a bit:
So, what is a typical String going to look like?Java Code:String x = "+x1 -x2 +x3";// where x1..xn represents numbers
How will you be receiving these Strings? From the command line? a text file? a GUI? a database?
What have you tried so far and what is the result?
What will you do with the String array once you have it?
Much luck!
- 08-08-2009, 07:47 PM #3
Senior Member
- Join Date
- Mar 2009
- Posts
- 552
- Rep Power
- 5
If you are getting input, try making the original string more like this...
[code]
string original = "x1;x2;x3;x4;x5;x6";
[code]
then using String.split(";") should return the array.
Of course, you can substitute any character in place of the semi-colon (';')If the above doesn't make sense to you, ignore it, but remember it - might be useful!
And if you just randomly taught yourself to program, well... you're just like me!
- 08-12-2009, 07:25 PM #4
Member
- Join Date
- Aug 2009
- Posts
- 2
- Rep Power
- 0
Similar Threads
-
storing strings into an array
By anthonym2121 in forum New To JavaReplies: 2Last Post: 04-04-2009, 07:32 AM -
String array to byte array?!
By Joe2003 in forum Advanced JavaReplies: 5Last Post: 02-28-2009, 06:09 AM -
Storing Array from HTTP Post
By kskinner in forum New To JavaReplies: 1Last Post: 09-08-2008, 06:00 AM -
String []Array
By Warren in forum New To JavaReplies: 4Last Post: 12-01-2007, 08:03 AM -
I can't seem to pass the value of a string variable into a string array
By mathias in forum Java AppletsReplies: 1Last Post: 08-03-2007, 10:52 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks