toDString

copy chars to string

  1. string toDString(const(char*) c_str)
    string
    toDString
    nothrow pure @trusted
    (
    const(char*) c_str
    )
  2. string toDStringFix(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