Use chained append calls in StringBuilder for improved memory usage, performance, and readability, and replace enhanced for loop with Java lambda expressions using .stream() API for better readability and functional programming.

Comment From: philwebb

Thanks for the suggestion but I prefer the code as it currently is.

Comment From: cmabdullah

Thank you for your response. I appreciate your feedback.