View source code
Display the source code in dmd/root/rmem.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.
Makes a null-terminated copy of the given string on newly allocated memory.
The null-terminator won't be part of the returned string slice. It will be
n is the length of the input string.
char xarraydup (
|s||string to copy|
A null-terminated copy of the input array.
auto s1 = "foo"; auto s2 = s1
.xarraydup; s2 = 'b'; writeln(s1); // "foo" writeln(s2); // "boo" writeln(*(s2 .ptr + s2 .length)); // '\0' string sEmpty; assert(sEmpty .xarraydup is null);
Walter Bright, https://www.digitalmars.com
Copyright © 1999-2023 by the D Language Foundation | Page generated by ddox.