On Thursday, 22 March 2018 at 07:34:18 UTC, David Bennett wrote:
On Thursday, 22 March 2018 at 04:49:39 UTC, Seb wrote:
```
alias lowercased = (m, n) =>
m.take(n).asLowerCase.chain(m.drop(n));
```
```
string input = "My Capital String";
auto lower1 =
On Thursday, 22 March 2018 at 04:49:39 UTC, Seb wrote:
No need for regular expressions. D is powerful enough without
them:
```
alias lowercased = (m, n) =>
m.take(n).asLowerCase.chain(m.drop(n));
```
https://run.dlang.io/is/cSL0si
And with the filter, so it passes the assert:
```
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked
through std.algorithm but didn't find anything.. Maybe I'm
blind.
What I would like to do is filter out all spaces in a string
and change the front letter to lower
On Wednesday, 21 March 2018 at 12:07:49 UTC, Simen Kjærås wrote:
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
unittest {
assert("my capitalized string".capitalize ==
"myCapitalizedString");
}
auto capitalize(string s) {
import std.regex, std.uni;
return
On Wednesday, 21 March 2018 at 12:53:56 UTC, Ali Çehreli wrote:
Here is another one that uses ForwardRange.
import std.range; // empty, take, save, chain, popFrontN;
import std.uni; // asLowerCase;
import std.algorithm; // equal, filter;
import std.conv; // text;
auto initialLowerCased(R)(R
On 03/21/2018 04:30 AM, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked through
std.algorithm but didn't find anything.. Maybe I'm blind.
What I would like to do is filter out all spaces in a string and change
the front letter to lower case:
string m =
On Wednesday, 21 March 2018 at 11:30:28 UTC, Timoses wrote:
Hey,
I'm struggling to find a way to achieve this. I've looked
through std.algorithm but didn't find anything.. Maybe I'm
blind.
What I would like to do is filter out all spaces in a string
and change the front letter to lower
Hey,
I'm struggling to find a way to achieve this. I've looked through
std.algorithm but didn't find anything.. Maybe I'm blind.
What I would like to do is filter out all spaces in a string and
change the front letter to lower case:
string m = "My Capital String";
string lower = m