Created
October 4, 2023 21:27
-
-
Save run-dlang/d4c6c0316ea5b919c1a744a428e3d0f8 to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std; | |
void main() | |
{ | |
string[] f(string s) | |
{ | |
return s.map!(_ => [_,'-'].to!string).array; | |
} | |
writeln(f("Hello")); // extected output: ["H-","e-","l-","l-","o-"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment