[#BloombergLP-bdlb-String-copy-0eb]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/String.adoc[String]::copy
:relfileprefix: ../../../
:mrdocs:

Create a null&hyphen;terminated copy of the specified `string`, using the specified `basicAllocator` to supply memory, and return the address of the newly&hyphen;created modifiable string&period; The string that is returned is owned by the caller&period; The behavior is undefined unless `bsl&colon;&colon;strlen(string) &lt;&equals; INT&lowbar;MAX` and `basicAllocator` is non&hyphen;null&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
char*
copy(
    char const* string,
    xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator);
----


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