------------------------------------------------------------------------------- */ Trims end-of-line marker from a string */ Usefull in conjunction with fgets() calls */ ------------------------------------------------------------------------------- */
| 503 | /* Usefull in conjunction with fgets() calls */ |
| 504 | /* ------------------------------------------------------------------------------- */ |
| 505 | void msStringTrimEOL(char *string) |
| 506 | { |
| 507 | int i; |
| 508 | |
| 509 | for(i=0 ; string[i] != '\0'; i++) { |
| 510 | if(string[i] == '\n') { |
| 511 | string[i] = '\0'; /* Terminate the string at the newline */ |
| 512 | return; |
| 513 | } |
| 514 | } |
| 515 | } |
| 516 | |
| 517 | /* ------------------------------------------------------------------------------- */ |
| 518 | /* Replace all occurances of old with new in str. */ |