String joiner in streams java
setOfTags.stream().collect(Collectors.joining(";"))
String joiner in streams java
setOfTags.stream().collect(Collectors.joining(";"))
string.join java 8
public class main {
public static void main(String args[]) {
String[] wordsToJoin = new String[] {"Hi", "there", "<3"};
// first argument is the delimeter
String example1 = String.join(", ", wordsToJoin);
// can also do this instead
String example2 = String.join("^ ","Hi","there","<3");
System.out.println(example1; // Hi, there, <3
System.out.println(example2); // Hi^there^<3
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us