3.2.41. strtrim

Trims the leading and trailing white spaces and tabs from a string.

Syntax:

char *strtrim (str)
char *str;

where:

str

The string to be converted.

Description

This macro trims the leading and trailing white spaces and tabs from a string. The original string is changed.

Return value

char *

A pointer to the first character of the trimmed string.

Example

add char myString[50]
cexpression strcpy(myString, "     String with spaces before and after.     ")
cexpression strtrim(myString)
printf "|%s|",  myString

See also

Copyright © 2002-2009 ARM Limited. All rights reserved.ARM DUI 0175K
Non-Confidential