[#BloombergLP-bdlb-String-trim-0bf] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/String.adoc[String]::trim :relfileprefix: ../../../ :mrdocs: `trim` overloads == Synopses Declared in `<bdlb_string.h>` Remove all leading and trailing whitespace characters from the specified `string`. If `string` consists of only whitespace then it will be empty (i.e., have 0 length) after this operation. The behavior is undefined unless `string‐>size() <= INT_MAX` (if applicable). See `bdlb_stringviewutil` for an identically named method having similar semantics taking (and returning) `bsl::string_view`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/bdlb/String/trim-03f.adoc[trim](char* string); ---- [.small]#xref:BloombergLP/bdlb/String/trim-03f.adoc[_» more..._]# Remove all leading and trailing whitespace characters from the specified `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/bdlb/String/trim-0ba.adoc[trim](xref:bsl/string.adoc[bsl::string]* string); ---- [.small]#xref:BloombergLP/bdlb/String/trim-0ba.adoc[_» more..._]# Remove all leading and trailing whitespace characters from the specified `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/bdlb/String/trim-07.adoc[trim](std::pmr::string* string); ---- [.small]#xref:BloombergLP/bdlb/String/trim-07.adoc[_» more..._]# Remove all leading and trailing whitespace characters from the specified `string`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/bdlb/String/trim-032.adoc[trim](std::string* string); ---- [.small]#xref:BloombergLP/bdlb/String/trim-032.adoc[_» more..._]# Remove all leading and trailing whitespace characters from the specified `string` having the specified `length`, and load into `length` the number of characters in the resulting (trimmed) string. If `string` consists of only whitespace then it will be empty (i.e., have 0 length) after this operation. The behavior is undefined unless `0 <= *length`. Note that `length` is both an input and output parameter. See `bdlb_stringviewutil` for an identically named method having similar semantics taking (and returning) `bsl::string_view`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static void xref:BloombergLP/bdlb/String/trim-0e.adoc[trim]( char* string, int* length); ---- [.small]#xref:BloombergLP/bdlb/String/trim-0e.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#