File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes converting string array to string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "converting string array to string" Watch "converting string array to string" New topic

converting string array to string

Aashish Paruthi

Joined: Apr 13, 2003
Posts: 7
I need to convert array of strings to string joined by ','(comma).
I have been trying to use
String []vars;
String someString=arrayToString(vars,',');
I get the following error:
cannot resolve symbol
Balaji Natarajan

Joined: Dec 05, 2002
Posts: 28
Try this...
Aashish Paruthi

Joined: Apr 13, 2003
Posts: 7
Thanks, but I was trying to use a predefined function in util or array class and it would give me as I mentioned "
cannot resolve symbol" . I wanted to know if the method exists or is it deprecated.
Which classes should I import or should I make it work?
Joel McNary

Joined: Aug 20, 2001
Posts: 1815
Two things:
1). Remember, any method call without an object becomes a method call to this. So your call to "arrayToString" is looking for that function in the current class.
2). I don't know of any standard Java class that will do what you are asking to do here. A quick search on Google shows that many people have written this method, but I don't see that this is part of SUN's API.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
Aashish Paruthi

Joined: Apr 13, 2003
Posts: 7
I got some fundamentals straightened out.
I agree. Here's the link:
subject: converting string array to string
Similar Threads
Local Array
restart a loop with labelled break
converting a double to a String
IP C-Class
comparing Stings help