[#BloombergLP-bdlb-String-ltrim-02b]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/String.adoc[String]::ltrim
:relfileprefix: ../../../
:mrdocs:

Remove leading whitespace and update `&ast;length` accordingly&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;string&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
ltrim(
    char* string,
    int* length);
----

== Description

Remove all leading whitespace characters from the specified `string` having the specified `length`, and load into `length` the number of characters in the resulting (trimmed) string&period; If `string` consists of only whitespace then it will be empty (i&period;e&period;, have 0 length) after this operation&period; The behavior is undefined unless `0 &lt;&equals; &ast;length`&period; Note that `length` is both an input and output parameter&period; See `bdlb&lowbar;stringviewutil` for an identically named method having similar semantics taking (and returning) `bsl&colon;&colon;string&lowbar;view`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *string*
| string to trim
| *length*
| length of `string`&semi; updated to the trimmed length
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
