Loading
Comma Delimeted String To List

Java Quick Notes

Refresh Your Java - Before Java Interview

We are Agile, believe in less Documentation - Only Quick notes (Java Interview Questions) of Java/J2ee Read more....


Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet
Not Included Yet

Go to SiteMap

Q)  Comma Delimeted String To List


Ans)

This Util Class holds a method that converta an ArrayList to
to Comma Separated String.

public class CommaDelimetedStringToList {
    /**
     * This method strips out the comma from the comma delimited value
     * @param commaDelimitedValue
     * @return ArrayList
     */
    public static ArrayList commaDelimetedStringToList (String commaDelimitedValue){
     commaDelimitedValue = commaDelimitedValue.trim();
     ArrayList list = new ArrayList();
     if (commaDelimitedValue.indexOf(",") > 0){
         StringTokenizer st = new StringTokenizer(commaDelimitedValue,",");
         while (st.hasMoreTokens()){
          list.add(st.nextToken());
         }
     } else {
      list.add(commaDelimitedValue);
     }
     return list;
    }
   
}



Back to top

------------------------- We hope you got necessary Info On -----------------------------------------

Comma Delimeted String To List


Comma Delimeted String To List

-------------------------------------------------------------------------------------------------------



Face Book
Request for a Mock Interview/Training

Get a PDF

Face Book
Same look (Read) on any device, this is Ads free