BasicString.ptr

Return pointer to the first element.

The pointer returned may be invalidated by further calls to other member functions that modify the object.

  1. inout(CharType)* ptr [@property getter]
    struct BasicString
    @property inout return pure nothrow @system @nogc
    static if(allowHeap)
    inout(CharType)*
    ptr
    ()
  2. inout(CharType)* ptr [@property getter]

Examples

BasicString!char str = "123";
char* ptr = str.ptr;
assert(ptr[0 .. 3] == "123");

Meta