[#BloombergLP-bdlb-String-copy-01] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/String.adoc[String]::copy :relfileprefix: ../../../ :mrdocs: `copy` overloads == Synopses Declared in `<bdlb_string.h>` Create a null‐terminated copy of the specified `string`, using the specified `basicAllocator` to supply memory, and return the address of the newly‐created modifiable string. The string that is returned is owned by the caller. The behavior is undefined unless `string.size() <= INT_MAX` and `basicAllocator` is non‐null. Note that if `string` contains any embedded null ('0') characters they will be propagated to the copy. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0d.adoc[copy]( xref:bsl/string.adoc[bsl::string] const& string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0d.adoc[_» more..._]# Create a null‐terminated copy of the specified `string`, using the specified `basicAllocator` to supply memory, and return the address of the newly‐created modifiable string. The string that is returned is owned by the caller. The behavior is undefined unless `bsl::strlen(string) <= INT_MAX` and `basicAllocator` is non‐null. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0eb.adoc[copy]( char const* string, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0eb.adoc[_» more..._]# Create a null‐terminated copy of the specified `string` having the specified `length` (in bytes), using the specified `basicAllocator` to supply memory, and return the address of the newly‐created modifiable string. The string that is returned is owned by the caller. The behavior is undefined unless `0 <= length` and `basicAllocator` is non‐null. Note that if `string` contains any embedded null ('0') characters they will be propagated to the copy. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static char* xref:BloombergLP/bdlb/String/copy-0e0.adoc[copy]( char const* string, int length, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* basicAllocator); ---- [.small]#xref:BloombergLP/bdlb/String/copy-0e0.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#