/ ************************************************** ******************* * Function name: divstring * Function: String intercept * Content: Split get the string * input before INDEX (start) Division Parameters: char * src, char * DEST, INDEX, CHAR DIVSION * Output parameters: * Input output parameters: * Return value: success - OK * failed - NG * Programmer: mmdeng * Update: 2004-07-17 * *********************************************************** ***************** / INT DivString (CHAR * SRC, CHAR * DEST, INDEX, CHAR DIVISION) {IF (INDEX <0) {debugLog ("Split location cannot be less than 0 "); return ng;} int count = 0; INT I, J; for (i = 0, j = 0; i
{
IF (SRC [I] == Division Count ;
IF (count == index && src [i]! = division) DEST [J ] = SRC [I];
}
DEST [J] = '/ 0';
Return OK;
}