String intercept

zhaozj2021-02-16  97

/ ************************************************** ******************* * 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;

}

转载请注明原文地址:https://www.9cbs.com/read-14378.html

New Post(0)