Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
12
Task/Copy-a-string/D/copy-a-string.d
Normal file
12
Task/Copy-a-string/D/copy-a-string.d
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
void main() {
|
||||
string src = "This is a string";
|
||||
|
||||
// copy contents:
|
||||
auto dest1 = src.idup;
|
||||
|
||||
// copy contents to mutable char array
|
||||
auto dest2 = src.dup;
|
||||
|
||||
// copy just the fat reference of the string
|
||||
auto dest3 = src;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue