aspose file tools*
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
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "converting string array to string" Watch "converting string array to string" New topic
Author

converting string array to string

Aashish Paruthi
Greenhorn

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
Greenhorn

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

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
Bartender

Joined: Aug 20, 2001
Posts: 1824

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
Greenhorn

Joined: Apr 13, 2003
Posts: 7
Thanks.
I got some fundamentals straightened out.
 
jQuery in Action, 2nd edition
 
subject: converting string array to string