Loading
Comma Delimted TO Array

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 Delimted String to String Array


Ans)

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

public CommaDelimtedStringToArray {

 /**
  * This method Coverts the CommaDelimited String to String Array.
  *
  */
    public String[] commaDelimetedStringToArray (String str) {
  System.out.println(" stringToArray  :: " + str);
  String[] strArray = null;
  if (str != null && str.trim().length() > 0) {
   StringTokenizer objStrToken = new StringTokenizer(str, ",");
   strArray = new String[objStrToken.countTokens() + 1];
   int i = 0;
   while (objStrToken.hasMoreTokens()) {
    strArray[i] = objStrToken.nextToken();
    // System.out.println(objStrToken.nextToken());
    i++;
   }

  }
  return strArray;
 }
}

 



Back to top

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

Comma Delimted TO Array


Comma Delimted TO Array

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



Face Book
Request for a Mock Interview/Training

Get a PDF

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