I think you can use indexOf. Then get the length of string.
Here is an example:
int iLen;
iEnd = sToken.indexOf(':', iEnd);
sTemp = sToken.substring(iBegin, iEnd);
iBegin = iEnd + 1;
iEnd++;
if( iFlag == 1 ) // Parsing to get the values of arguments
{
iLen = Integer.parseInt(sTemp);
sTemp = sToken.substring(iBegin, iBegin + Len);
iEnd = iBegin + iLen + 1;
iBegin = iEnd;
}
return sTemp;
Thanks,
Angela