Quote and Join

Run Settings
LanguageJava
Language Version
Run Command
import java.util.stream.Collectors; import java.util.stream.Stream; class QuoteAndJoin { public static void main(String[] args) { String[] names = {"Donald Duck", "Mickey Mouse"}; String joined = Stream.of(names).map(e -> "'" + e + "'").collect(Collectors.joining(",")); System.out.println(joined); String joined2 = Stream.of(names).collect(Collectors.joining("','","'","'")); System.out.println(joined2); } }
Editor Settings
Theme
Key bindings
Full width
Lines