I got String from the database which have multiple commas (,) . I want to remove the last comma but I can\'t really find a simple way of doing it.
,
You can do something like this using 'Java 8'
private static void appendNamesWithComma() { List namesList = Arrays.asList("test1", "tester2", "testers3", "t4"); System.out.println(namesList.stream() .collect(Collectors.joining(", "))); }