Remove leading and trailing whitespace.

Synopsis

Declared in <folly/String.h>

StringPiece
trimWhitespace(StringPiece sp);

Description

Returns a subpiece with all whitespace removed from the back and front of sp. Whitespace means any of [' ', ' ]', 'r', 't'].

Return Value

A subpiece with leading and trailing whitespace removed.

Parameters

Name

Description

sp

The input piece to trim.

Created with MrDocs