Skip to content

Commit 9919849

Browse files
author
zahar.kalosha
committed
Add String.join()
1 parent 140bfd9 commit 9919849

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/example/postgresdemo/service/QuestionService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ResponseEntity<?> delete(Long questionId) {
5151
private QuestionResponseDTO toQuestionResponseDTO(Question question) {
5252
QuestionResponseDTO questionResponse = new QuestionResponseDTO();
5353
questionResponse.setId(question.getId());
54-
questionResponse.setBody(question.getTitle() + "\n" + question.getDescription());
54+
questionResponse.setBody(String.join("\n", question.getTitle(), question.getDescription()));
5555

5656

5757
return questionResponse;

0 commit comments

Comments
 (0)