Author : Arfan Youshuf

How to convert a String List to Comma Seprated String

Stream Collectors.joining import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; //———————— public class YourClass { public static void main(String[] args) { List list = Arrays.asList(“a”, “b”, “c”); String result = list.stream().collect(Collectors.joining(“,”)); System.out.println(result); } } Output: a,b,c String.join import java.util.Arrays; import java.util.List; public class MyClass { public static void main(String[] args) { List list = Arrays.asList(“a”,”b”,”c”); String result […]

Update Node.js to Latest Version on Linux | Ubuntu

Update Node.js with NVM (Node Version Manager) There are many ways that can be used to update the node version on a linux system. Bu the best and the recomended would be using the Node Version Manager. 1. Update the package repository sudo apt update 2. Install NVM using either curl or wget command . […]

Access Javascript Nested objects or Attributes safely

Access Javascript Nested objects or Attributes safely It is very likely to get run time exceptions on trying to read value of undefined or null objects in Javascript. There are two ways we can solve this common development issue. The optional chaining operator, also known as the safe navigation operator, is a feature of ECMAScript […]

Scroll to top