BloombergLP::bslstl::StringRefImp::StringRefImp

Create a string reference to a substring.

Synopsis

Declared in <bslstl_stringref.h>

StringRefImp(
    StringRefImp const& original,
    size_type startIndex,
    size_type numCharacters);

Description

Create a string-reference object having a valid std::string value, whose external representation begins at the specified startIndex in the specified original string reference, and extends either the specified numCharacters or until the end of the original string reference, whichever comes first. The external representation must remain valid as long as it is bound to this string reference. The behavior is undefined unless startIndex <= original.length(). Note that if startIndex is original.length() an empty string reference is returned.

Parameters

NameDescription
originalstring reference providing the external data
startIndexstarting index within original
numCharactersmaximum number of characters to reference