libite
Functions
strtrim.c File Reference
#include <ctype.h>
#include <errno.h>
#include <stdlib.h>
#include "lite.h"
Include dependency graph for strtrim.c:

Functions

char * strtrim (char *str)
 Strip leading and trailing whitespace from a string. More...
 

Detailed Description

Author
Mattias Walström
Joachim Wiberg
Date
2014,2021

Function Documentation

◆ strtrim()

char* strtrim ( char *  str)

Strip leading and trailing whitespace from a string.

Parameters
strThe string to trim

Trims a string from any leading and trailing white-space, returns the trimmed result in the same buffer.

Returns
If str is a valid, non-NULL string this function returns the same string stripped from whitespace. This function only returns NULL if str itself is NULL.