Use the Google Guava API‘s join
method:
Joiner.on(",").join(collectionOfStrings);
More Related Contents:
- Cleanest way to build an SQL string in Java
- How to implement a SQL like ‘LIKE’ operator in java?
- Hours and seconds are lost when storing a date in the database [closed]
- StringBuilder vs String concatenation in toString() in Java
- How do I convert from int to String?
- Sort on a string that may contain a number
- String’s Maximum length in Java – calling length() method
- How to split a comma-separated string?
- length and length() in Java
- How to format a Java string with leading zero?
- Convert array of strings into a string in Java
- Should I use string.isEmpty() or “”.equals(string)?
- How to insert a character in a string at a certain position?
- Understanding logic in CaseInsensitiveComparator
- How to shuffle characters in a string without using Collections.shuffle(…)?
- handling DATETIME values 0000-00-00 00:00:00 in JDBC
- Closing a Scanner throws java.util.NoSuchElementException
- String replacement in java, similar to a velocity template
- How to center a string using String.format?
- Read String line by line
- How to get the last characters in a String in Java, regardless of String size
- How to create variables dynamically in Java? [closed]
- substring index range
- How to replace � in a string
- How to remove large if-else-if chain [duplicate]
- Find all numbers in the String [closed]
- Is it possible in Java to override ‘toString’ for an Objects array?
- Can we access or query the Java String intern (constant) pool?
- How to escape colon `:` within a native SQL query in Hibernate?
- Java printf using variable field size?