toDStringFix

copy chars to string

  1. string toDString(const(char*) c_str)
  2. string toDStringFix(const(char[S]) c_buf)
    string
    toDStringFix
    nothrow pure @trusted
    (
    size_t S
    )
    (
    const(char[S]) c_buf
    )

Examples

auto c = [ 'a', 'b', 'c', '\0', 'd', 'e' ];
assertEq( toDString( c.ptr ), "abc" );
char[6] c = [ 'a', 'b', 'c', '\0', 'd', 'e' ];
assertEq( toDStringFix(c), "abc" );

Meta