You can also turn your function into a fold.
auto searches = ["1", "2"];
writeln (searches.fold!((a, b) => a.substitute(b,
"number").to!string)("come 1 come 2")) ;
On Saturday, 11 January 2020 at 17:10:02 UTC, Martin Brezl wrote:
Hi,
i have a function like this:
```
import std.algorithm.iteration : substitute;
//...
string replace(string content, string[] searches , string
replace) {
if(searches.empty) return content;
auto resul
On Saturday, 11 January 2020 at 17:10:02 UTC, Martin Brezl wrote:
Hi,
i have a function like this:
```
[...]
auto result = content.substitute(searches.front,replace);
for(size_t i=1; i < searches.length; i++) {
searches.popFront();
result = result.substitu
Hi,
i have a function like this:
```
import std.algorithm.iteration : substitute;
//...
string replace(string content, string[] searches , string
replace) {
if(searches.empty) return content;
auto result = content.substitute(searches.front,replace);
for(size_t
I am trying to run example code from
https://tour.dlang.org/tour/en/dub/lubeck
example.d:
---
/+dub.sdl:
dependency "lubeck" version="~>1.1"
+/
import lubeck: mtimes;
import mir.algorithm.iteration: each;
import mir.ndslice;
import std.stdio: writeln;
void main()
{
auto n = 5;
// Magic
On Saturday, 11 January 2020 at 12:22:25 UTC, Marcone wrote:
wchar[1024] szFileName = 0;
ofn.lpstrFile = cast(LPWSTR) szFileName;
You shouldn't cast there, just use `szFileName.ptr` instead.
ofn.nMaxFile = MAX_PATH;
and this should be the length of the array. It may require a ca
On Saturday, 11 January 2020 at 12:38:38 UTC, Adnan wrote:
How would someone approach parsing epub files in D? Is there
any libraries to parse XHTML?
I've done it before with my dom.d easily enough.
The epub itself is a zip file. You might simply unzip it ahead of
time, or use std.zip to acce
On Saturday, 11 January 2020 at 12:38:38 UTC, Adnan wrote:
How would someone approach parsing epub files in D? Is there
any libraries to parse XHTML?
XHTML is XML. There are libraries to parse XML, from std.xml in
the standard library to libraries like dxml in the package
repository.
How would someone approach parsing epub files in D? Is there any
libraries to parse XHTML?
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank you
very much.
Solution:
import std;
import core.sys.windows.windows;
pragma(lib, "comdlg32");
// Function askop
On Saturday, 11 January 2020 at 10:34:34 UTC, Marcone wrote:
This code works, but I can't get file Path. Someone can help me?
import std;
import core.sys.windows.windows;
pragma(lib, "comdlg32");
void main(){
OPENFILENAME ofn;
wchar* szFileName;
You need to supply a buffer, not a poin
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank you
very much.
This code works, but I can't get file Path. Someone can help me?
import std;
import core.sys.windo
On Saturday, 11 January 2020 at 00:12:03 UTC, René Heldmaier
wrote:
On Friday, 10 January 2020 at 14:48:49 UTC, Marcone wrote:
How create "Open" and "Save as" Dialog using "Win32 Api" and
Dlang? Please send me a simple example code in Dlang. Thank
you very much.
Have a look at this website:
On Friday, 10 January 2020 at 15:44:53 UTC, Mike Parker wrote:
On Friday, 10 January 2020 at 15:06:07 UTC, Marcone wrote:
Very complicated. Can you send me the simple clear code?
https://docs.microsoft.com/en-us/windows/win32/dlgbox/using-common-dialog-boxes
Not compile in Dlang.
14 matches
Mail list logo