On Friday, 28 October 2016 at 15:08:59 UTC, Chris wrote:
On Friday, 28 October 2016 at 14:31:47 UTC, Chris wrote:
[...]
What you basically do is you pass the logic on to `map` and
`map` applies it to each item in the range (cf. [1]):
[...]
The life is beautiful !
Thx.
On Friday, 28 October 2016 at 14:31:47 UTC, Chris wrote:
On Friday, 28 October 2016 at 13:50:24 UTC, Alfred Newman wrote:
It boils down to something like:
if (c in _accent)
return _accent[c];
else
return c;
Just a normal lambda (condition true) ? yes : no;
I'd recommend you to use Marc's
On Friday, 28 October 2016 at 13:50:24 UTC, Alfred Newman wrote:
On Friday, 28 October 2016 at 11:40:37 UTC, Chris wrote:
[...]
@Chris
As a new guy in the D community, I am not sure, but I think the
line below is something like a Python's lambda, right ?
auto removed = to!string(str.map!(a
On Friday, 28 October 2016 at 11:40:37 UTC, Chris wrote:
On Friday, 28 October 2016 at 11:24:28 UTC, Alfred Newman wrote:
Hello,
I'm getting some troubles to replace the accented letters in a
given string with their unaccented counterparts.
Let's say I have the following input string "très é
On Friday, 28 October 2016 at 12:52:04 UTC, Marc Schütz wrote:
On Friday, 28 October 2016 at 11:24:28 UTC, Alfred Newman wrote:
[...]
import std.stdio;
import std.algorithm;
import std.uni;
import std.conv;
void main()
{
auto str = "très élégant";
immutable accents = unicode.Diacritic
On Friday, 28 October 2016 at 11:24:28 UTC, Alfred Newman wrote:
Hello,
I'm getting some troubles to replace the accented letters in a
given string with their unaccented counterparts.
Let's say I have the following input string "très élégant" and
I need to create a function to return just "t
On Friday, 28 October 2016 at 11:24:28 UTC, Alfred Newman wrote:
Hello,
I'm getting some troubles to replace the accented letters in a
given string with their unaccented counterparts.
Let's say I have the following input string "très élégant" and
I need to create a function to return just "t
Hello,
I'm getting some troubles to replace the accented letters in a
given string with their unaccented counterparts.
Let's say I have the following input string "très élégant" and I
need to create a function to return just "tres elegant".
Considering we need to take care about unicode char