angular 9+how to remove comma from right side of a string code example Example: remove last comma from string javascript str = str.replace(/,\s*$/, "");