MCPcopy Index your code
hub / github.com/MapServer/MapServer / msStringTrimLeft

Function msStringTrimLeft

mapstring.c:452–483  ·  view source on GitHub ↗

** Remove leading white spaces and shift everything to the left. */

Source from the content-addressed store, hash-verified

450** Remove leading white spaces and shift everything to the left.
451*/
452char *msStringTrimLeft(char *string)
453{
454 char *read, *write;
455 int i, length;
456
457 if (string && strlen(string) > 0)
458 {
459 length = strlen(string);
460 read = string;
461 write = string;
462
463 for (i=0; i<length; i++)
464 {
465 if (isspace(string[i]))
466 read++;
467 else
468 break;
469 }
470
471 if (read > write)
472 {
473 while (*read)
474 {
475 *write = *read;
476 read++;
477 write++;
478 }
479 *write = '\0';
480 }
481 }
482 return string;
483}
484
485/* ------------------------------------------------------------------------------- */
486/* Trims trailing blanks from a string */

Callers 3

msWMSSetTimePatternFunction · 0.85
msWMSFeatureInfoFunction · 0.85
msWriteMapContextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected