Monday, October 20, 2014

How to put array in string like [1,2,3,4] to 1,2,3,4

here is a simple trick :)

String listOfPhase =""

        for (int i = 0; i < phaseIds.size(); i++) {
            if (i == 0)
                listOfPhase += phaseIds[i].toString()
            else
                listOfPhase += "," + phaseIds[i].toString()
        }


NOTE : phaseIds is your array 

0 comments:

Post a Comment