| 381 | |
| 382 | |
| 383 | cString cString::Pop(const char delim) |
| 384 | { |
| 385 | int pos; |
| 386 | cString rv(""); |
| 387 | if( (pos=Find(delim)) >= 0 ){ // if it is found at all |
| 388 | if( pos > 0 ){ // if the first char is not delim, return substring |
| 389 | rv = Substring(0,pos); |
| 390 | } |
| 391 | // Trim off the front |
| 392 | InsertStr(0, NULL, 0, pos+1); |
| 393 | } |
| 394 | |
| 395 | // If the deliminator is *not* found, return the whole string. |
| 396 | else { |
| 397 | rv = *this; |
| 398 | *this = ""; |
| 399 | } |
| 400 | return rv; |
| 401 | } |
| 402 | |
| 403 | |
| 404 | cString cString::PopWord() |
no outgoing calls
no test coverage detected