• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

convert collections to string

 
ssasi kumar
Greenhorn
Posts: 26
Chrome Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,

i have one doubt how to convert collections(ArrayList,List,vector) to string......





with regards,

sasikumar
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Collections of what ? And how do you intend to separate each item ?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15356
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just call toString() on the collection.
 
Anooj Narvekar
Greenhorn
Posts: 10
IntelliJ IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Collections override toString method. It internally calls toString of Objects its holding. So if the objects its holding has overriden toString as required, then collection.toString should be what you actually want.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic