Skip to content

Commit

Permalink
StringJoiner
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagogomes187 committed Aug 27, 2023
1 parent 58fd4a2 commit 0742fe2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion StringJoiner/src/StringJoinerExemplo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
public class StringJoinerExemplo {

public static void main(String[] args) {

//StringTokenizer
String nomes = " João, Pedro, Maria, Ana, Paulo";

StringTokenizer st = new StringTokenizer(nomes, ",");
Expand All @@ -14,7 +16,8 @@ public static void main(String[] args) {

/****************************************************/

StringJoiner sj = new StringJoiner(", ");
//StringJoiner
StringJoiner sj = new StringJoiner(" - ");

sj.add("João");
sj.add("Pedro");
Expand Down

0 comments on commit 0742fe2

Please sign in to comment.