[#BloombergLP-bdld-Datum-createStringRef-01] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdld.adoc[bdld]::xref:BloombergLP/bdld/Datum.adoc[Datum]::createStringRef :relfileprefix: ../../../ :mrdocs: Return a datum referring to the specified null‐terminated string. == Synopsis Declared in `<bdld_datum.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static xref:BloombergLP/bdld/Datum.adoc[Datum] createStringRef( char const* string, xref:BloombergLP/bdld/Datum/AllocatorType.adoc[AllocatorType] const& allocator); ---- == Description Return, by value, a datum that refers to the specified `string`, using the specified `allocator` to supply memory (if needed). The behavior is undefined unless `string` points to a UTF‐8 encoded c‐string. The behavior is also undefined unless 'strlen(string) <= UINT_MAX'. Note that `string` is not copied, and is not freed if `Datum::destroy` is called on the returned object. == Return Value a datum referring to the specified null‐terminated string == Parameters [cols="1,4"] |=== | Name| Description | *string* | UTF‐8 null‐terminated string to reference | *allocator* | memory allocator to use |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#