On Monday, 9 June 2014 at 20:01:05 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 19:47:29 UTC, Chris wrote:
Uh, I see, I misread the signature of std.string.strip(). So
that's one option now, to strip all trailing hyphens with
std.string.strip(). Well, I'll give it a shot tomorrow.
No,
On Monday, 9 June 2014 at 19:54:08 UTC, Chris wrote:
I think it makes sense to put any generic range based
algorithms (split and so forth) into std.algorithm. It's always
my first port of call, when I have a range. However, that you
can do
std.string.split([1, 2, 3], 2);
is not exactly a des
On Monday, 9 June 2014 at 19:47:29 UTC, Chris wrote:
Uh, I see, I misread the signature of std.string.strip(). So
that's one option now, to strip all trailing hyphens with
std.string.strip(). Well, I'll give it a shot tomorrow.
No, you read the documentation of std.*STRING*.strip correctly.
I
On Monday, 9 June 2014 at 18:09:07 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 17:57:24 UTC, Steven Schveighoffer
wrote:
I think we are confusing things here, I was talking about
strip :)
strip and split are actually both pretty much in the same boat
actually in regards to that, so ju
On Monday, 9 June 2014 at 15:52:24 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 15:19:05 UTC, Chris wrote:
On Monday, 9 June 2014 at 14:47:45 UTC, Steven Schveighoffer
wrote:
On Mon, 09 Jun 2014 10:39:39 -0400, Chris
wrote:
Atm, I have
auto parts = appender!(string[]);
w.splitter('-
On Monday, 9 June 2014 at 17:57:24 UTC, Steven Schveighoffer
wrote:
I think we are confusing things here, I was talking about strip
:)
strip and split are actually both pretty much in the same boat
actually in regards to that, so just 's/split/strip/g', and the
same answer will apply.
"spli
On Mon, 09 Jun 2014 12:06:13 -0400, monarch_dodra
wrote:
On Monday, 9 June 2014 at 15:54:29 UTC, Steven Schveighoffer wrote:
On Mon, 09 Jun 2014 11:49:29 -0400, monarch_dodra
wrote:
On Monday, 9 June 2014 at 14:21:21 UTC, Steven Schveighoffer wrote:
Just looked at std.string for a strip
On Monday, 9 June 2014 at 15:54:29 UTC, Steven Schveighoffer
wrote:
On Mon, 09 Jun 2014 11:49:29 -0400, monarch_dodra
wrote:
On Monday, 9 June 2014 at 14:21:21 UTC, Steven Schveighoffer
wrote:
Just looked at std.string for a strip function that allows
custom character strippage, but apparent
On Mon, 09 Jun 2014 11:49:29 -0400, monarch_dodra
wrote:
On Monday, 9 June 2014 at 14:21:21 UTC, Steven Schveighoffer wrote:
Just looked at std.string for a strip function that allows custom
character strippage, but apparently not there. The above is quite
awkward.
-Steve
It's in algo
On Monday, 9 June 2014 at 15:19:05 UTC, Chris wrote:
On Monday, 9 June 2014 at 14:47:45 UTC, Steven Schveighoffer
wrote:
On Mon, 09 Jun 2014 10:39:39 -0400, Chris
wrote:
Atm, I have
auto parts = appender!(string[]);
w.splitter('-').filter!(a => !a.empty).copy(parts);
Which looks more elega
On Monday, 9 June 2014 at 14:21:21 UTC, Steven Schveighoffer
wrote:
Just looked at std.string for a strip function that allows
custom character strippage, but apparently not there. The above
is quite awkward.
-Steve
It's in algorithm, because it's more generic than just strings.
On Monday, 9 June 2014 at 14:47:45 UTC, Steven Schveighoffer
wrote:
On Mon, 09 Jun 2014 10:39:39 -0400, Chris
wrote:
Atm, I have
auto parts = appender!(string[]);
w.splitter('-').filter!(a => !a.empty).copy(parts);
Which looks more elegant and gives me what I want. IMO, the
module that han
On Mon, 09 Jun 2014 10:39:39 -0400, Chris wrote:
Atm, I have
auto parts = appender!(string[]);
w.splitter('-').filter!(a => !a.empty).copy(parts);
Which looks more elegant and gives me what I want. IMO, the module that
handles the splitting of hyphenated words should be able to deal with
On Monday, 9 June 2014 at 14:21:21 UTC, Steven Schveighoffer
wrote:
On Mon, 09 Jun 2014 07:04:11 -0400, Chris
wrote:
On Monday, 9 June 2014 at 10:54:09 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 10:23:16 UTC, Chris wrote:
Ok, thanks. I'll keep that in mind for the next version.
On Mon, 09 Jun 2014 07:04:11 -0400, Chris wrote:
On Monday, 9 June 2014 at 10:54:09 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 10:23:16 UTC, Chris wrote:
Ok, thanks. I'll keep that in mind for the next version.
Seems to me to also work with 2.065 and 2.064.
From the library ref
On Monday, 9 June 2014 at 12:16:30 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 11:40:24 UTC, Chris wrote:
On Monday, 9 June 2014 at 11:16:18 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 11:04:12 UTC, Chris wrote:
From the library reference:
assert(equal(splitter("hello world",
On Monday, 9 June 2014 at 11:40:24 UTC, Chris wrote:
On Monday, 9 June 2014 at 11:16:18 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 11:04:12 UTC, Chris wrote:
From the library reference:
assert(equal(splitter("hello world", ' '), [ "hello", "",
"world" ]));
and
"If a range with on
On Monday, 9 June 2014 at 11:16:18 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 11:04:12 UTC, Chris wrote:
From the library reference:
assert(equal(splitter("hello world", ' '), [ "hello", "",
"world" ]));
and
"If a range with one separator is given, the result is a range
with two
On Monday, 9 June 2014 at 11:04:12 UTC, Chris wrote:
From the library reference:
assert(equal(splitter("hello world", ' '), [ "hello", "",
"world" ]));
and
"If a range with one separator is given, the result is a range
with two empty elements."
My problem was that if I have input like
a
On Monday, 9 June 2014 at 10:54:09 UTC, monarch_dodra wrote:
On Monday, 9 June 2014 at 10:23:16 UTC, Chris wrote:
Ok, thanks. I'll keep that in mind for the next version.
Seems to me to also work with 2.065 and 2.064.
From the library reference:
assert(equal(splitter("hello world", ' '),
On Monday, 9 June 2014 at 10:23:16 UTC, Chris wrote:
Ok, thanks. I'll keep that in mind for the next version.
Seems to me to also work with 2.065 and 2.064.
On Monday, 9 June 2014 at 10:14:40 UTC, bearophile wrote:
Chris:
auto word = "bla-bla";
auto parts = appender!(string[]);
w.splitter('-').copy(parts);
// parts.data.length == 3 ["bla", "", "bla"]
With the current dmd 2.066alpha this code:
void main() {
import std.stdio, std.string, std.a
Chris:
auto word = "bla-bla";
auto parts = appender!(string[]);
w.splitter('-').copy(parts);
// parts.data.length == 3 ["bla", "", "bla"]
With the current dmd 2.066alpha this code:
void main() {
import std.stdio, std.string, std.algorithm;
const txt = "bla-bla";
txt.split("-").wri
Say I wanna split a string that contains hyphens. If I use
std.algorithm.splitter I end up with empty elements for each
hyphen, e.g.:
auto word = "bla-bla";
auto parts = appender!(string[]);
w.splitter('-').copy(parts);
// parts.data.length == 3 ["bla", "", "bla"]
This is not ideal for my purp
24 matches
Mail list logo