aspose file tools*
The moose likes Beginning Java and the fly likes join list of strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "join list of strings" Watch "join list of strings" New topic
Author

join list of strings

lajos kamocsay
Ranch Hand

Joined: Aug 12, 2006
Posts: 37
Is there an easy way to join a list of string in java using a delimiter?
For example:



I would like to make that into a path string, "/home/joe/tmp/". I can do:



But it seems there should be something in the API to do this ain one step. Python has:



Anything like that in Java?


Thanks.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24168
    
  30

No.


[Jess in Action][AskingGoodQuestions]
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
No, but you could write one fairly easily using varargs in 1.5:



Usage: join("/", "home", "joe", "tmp)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: join list of strings
 
Similar Threads
large system.in to object concurrent operations
How to pass a dynamic parameter in struts-config.xml?
Different reults of execution of jar from terminal and by double clicking
NullPointerException Just Does Not Make Sense
Listing all directories from a given root in batch file