Java - Write code to Add a value to an existing comma-delimited string

Requirements

Write code to Add a value to an existing comma-delimited string

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String existing = "book2s.com";
        String value = "book2s.com";
        System.out.println(addCommaDelimited(existing, value));
    }//from  w  ww .  j a va 2s. c  o  m

    /**
     * Add a value to an existing comma-delimited string
     */
    public static String addCommaDelimited(String existing, String value) {
        return existing + "," + value;
    }
}

Related Exercise