Java tutorial
public class Main { public static void main(String[] args) { String str = "A,B,C,D"; // Split str using a comma as the delimiter String[] parts = str.split(","); // Print the the string and its parts System.out.println(str); for (String part : parts) { System.out.println(part); } } }