Re: String Comparison Operator

2017-04-30 Thread Xinok via Digitalmars-d-learn
On Sunday, 30 April 2017 at 19:05:18 UTC, bauss wrote: On Sunday, 30 April 2017 at 16:15:41 UTC, Xinok wrote: On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? Yeah, just the usual comparison operators: "abc" == "abc

Re: String Comparison Operator

2017-04-30 Thread ag0aep6g via Digitalmars-d-learn
On 04/30/2017 09:05 PM, bauss wrote: On Sunday, 30 April 2017 at 16:15:41 UTC, Xinok wrote: [...] ~ is for string concatenation, i.e.: [...] It's not actually a string concatenation operator, it's an array appending operator. Appending is related but distinct. `~` does concatenation. `~=`

Re: String Comparison Operator

2017-04-30 Thread bauss via Digitalmars-d-learn
On Sunday, 30 April 2017 at 16:15:41 UTC, Xinok wrote: On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? Yeah, just the usual comparison operators: "abc" == "abc" "abc" != "ABC" ~ is for s

Re: String Comparison Operator

2017-04-30 Thread tcak via Digitalmars-d-learn
On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? You normally use double equation marks (==) to do that. auto name = "Jack"; if( name == "Jack" ) writeln("Hi Jack!");

Re: String Comparison Operator

2017-04-30 Thread Xinok via Digitalmars-d-learn
On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? Yeah, just the usual comparison operators: "abc" == "abc" "abc" != "ABC" ~ is for string concatenation, i.e.: "abc" ~ "def" == "abcdef"

Re: String Comparison Operator

2017-04-30 Thread 無 via Digitalmars-d-learn
On Sunday, 30 April 2017 at 15:31:39 UTC, Jolly James wrote: Is there a String Comparison Operator in D? ~

String Comparison Operator

2017-04-30 Thread Jolly James via Digitalmars-d-learn
Is there a String Comparison Operator in D?

Re: string comparison

2010-12-22 Thread Stanislav Blinov
On 12/21/2010 10:51 PM, Jonathan M Davis wrote: With newsgroups, I never got the moderation warning either. But I did get that moderation message and then waited almost a day to see my message in the list. But this happened only to the first message in each list. The first message sent to

Re: string comparison

2010-12-21 Thread Stanislav Blinov
20.12.2010 22:06, Steven Schveighoffer пишет: On Mon, 20 Dec 2010 14:05:56 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov bli...@loniir.ru wrote: And lastly, hasn't this by chance been your first post? AFAIR, the first message is

Re: string comparison

2010-12-21 Thread Steven Schveighoffer
On Tue, 21 Dec 2010 11:12:00 -0500, Stanislav Blinov bli...@loniir.ru wrote: 20.12.2010 22:06, Steven Schveighoffer пишет: On Mon, 20 Dec 2010 14:05:56 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov bli...@loniir.ru wrote:

Re: string comparison

2010-12-21 Thread spir
On Tue, 21 Dec 2010 11:49:42 -0500 Steven Schveighoffer schvei...@yahoo.com wrote: Hm... I always use a newsgroup client, so maybe. But in any case, I've never known anyone to have been blocked from posting, and the newsgroup interface does not have any moderation on it. I'd be surprised

Re: string comparison

2010-12-21 Thread Stanislav Blinov
21.12.2010 19:55, spir пишет: On Tue, 21 Dec 2010 11:49:42 -0500 Steven Schveighofferschvei...@yahoo.com wrote: Hm... I always use a newsgroup client, so maybe. But in any case, I've never known anyone to have been blocked from posting, and the newsgroup interface does not have any

Re: string comparison

2010-12-21 Thread Jonathan M Davis
On Tuesday, December 21, 2010 09:36:20 Stanislav Blinov wrote: 21.12.2010 19:55, spir пишет: On Tue, 21 Dec 2010 11:49:42 -0500 Steven Schveighofferschvei...@yahoo.com wrote: Hm... I always use a newsgroup client, so maybe. But in any case, I've never known anyone to have been

Re: string comparison

2010-12-21 Thread doubleagent
In general though, it's preferred that you post a link to code rather than attach it I'll try to remember that.

Re: string comparison

2010-12-20 Thread Lars T. Kyllingstad
On Sun, 19 Dec 2010 07:01:30 +, doubleagent wrote: Andrei's quick dictionary illustration [in his book, 'The D Programming Language'] doesn't seem to work. Code attached. That's strange. I ran the example you posted using DMD 2.050 myself, and it works for me. Are you 100% sure that

Re: string comparison

2010-12-20 Thread Stanislav Blinov
20.12.2010 8:35, doubleagent пишет: Compared to the relatively snappy response other threads have been receiving I'm going to assume that nobody is interested in my inquiry. That's cool. Can anybody point me to an IRC chatroom for D noobs, and is there anywhere to post errata for the book?

Re: string comparison

2010-12-20 Thread Jonathan M Davis
On Monday, December 20, 2010 06:01:23 Lars T. Kyllingstad wrote: On Sun, 19 Dec 2010 07:01:30 +, doubleagent wrote: Andrei's quick dictionary illustration [in his book, 'The D Programming Language'] doesn't seem to work. Code attached. That's strange. I ran the example you posted

Re: string comparison

2010-12-20 Thread Steven Schveighoffer
On Mon, 20 Dec 2010 00:35:53 -0500, doubleagent doubleagen...@gmail.com wrote: Compared to the relatively snappy response other threads have been receiving I'm going to assume that nobody is interested in my inquiry. Just a tip, don't expect snappy responses on Sunday... We all have

Re: string comparison

2010-12-20 Thread doubleagent
Are you 100% sure that you are running this version I have to be. There are no other versions of phobos on this box and 'which dmd' points to the correct binary. dictionary[word.idup] = newId; That fixes it. The 'word' array is mutable and reused by byLine() on each iteration. By doing

Re: string comparison

2010-12-20 Thread doubleagent
I understand. Thank you, and thanks for pointing out the chatroom.

Re: string comparison

2010-12-20 Thread Steven Schveighoffer
On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov bli...@loniir.ru wrote: And lastly, hasn't this by chance been your first post? AFAIR, the first message is being moderated so it doesn't get to the public at once. BTW, this message board is not moderated. -Steve

Re: string comparison

2010-12-20 Thread Steven Schveighoffer
On Mon, 20 Dec 2010 14:05:56 -0500, Steven Schveighoffer schvei...@yahoo.com wrote: On Mon, 20 Dec 2010 11:13:34 -0500, Stanislav Blinov bli...@loniir.ru wrote: And lastly, hasn't this by chance been your first post? AFAIR, the first message is being moderated so it doesn't get to the

Re: string comparison

2010-12-20 Thread doubleagent
The reason that std.string.splitter() does not show in the documentation is that its return type is auto, and there is currently a bug in ddoc that makes it so that auto functions don't end up in the generated documentation. Looking at the code, it pretty much just forwards to

Re: string comparison

2010-12-20 Thread Jonathan M Davis
On Monday, December 20, 2010 10:44:12 doubleagent wrote: Are you 100% sure that you are running this version I have to be. There are no other versions of phobos on this box and 'which dmd' points to the correct binary. dictionary[word.idup] = newId; That fixes it. The 'word'

Re: string comparison

2010-12-20 Thread Lars T. Kyllingstad
On Mon, 20 Dec 2010 18:44:12 +, doubleagent wrote: Are you 100% sure that you are running this version I have to be. There are no other versions of phobos on this box and 'which dmd' points to the correct binary. dictionary[word.idup] = newId; That fixes it. The 'word' array

Re: string comparison

2010-12-20 Thread doubleagent
Okay. I don't know what the actual code looks like Here. import std.stdio, std.string; void main() { uint[string] dictionary; // v[k], so string-uint foreach (line; stdin.byLine()) { // break sentence into words // Add each word in the sentence

Re: string comparison

2010-12-20 Thread doubleagent
This could be related to bug 2954, for which a fix will be released in the next version of DMD. Looking at that new descriptive error message ie error(associative arrays can only be assigned values with immutable keys, not %s, e2-type-toChars()); it appears to be a distinct possibility.

Re: string comparison

2010-12-20 Thread Jonathan M Davis
On Monday, December 20, 2010 16:45:20 doubleagent wrote: Okay. I don't know what the actual code looks like Here. import std.stdio, std.string; void main() { uint[string] dictionary; // v[k], so string-uint foreach (line; stdin.byLine()) { // break

Re: string comparison

2010-12-20 Thread doubleagent
Good I agree.

Re: string comparison

2010-12-19 Thread doubleagent
Compared to the relatively snappy response other threads have been receiving I'm going to assume that nobody is interested in my inquiry. That's cool. Can anybody point me to an IRC chatroom for D noobs, and is there anywhere to post errata for the book?

Re: string comparison

2010-12-19 Thread Jonathan M Davis
On Saturday 18 December 2010 23:01:30 doubleagent wrote: Andrei's quick dictionary illustration [in his book, 'The D Programming Language'] doesn't seem to work. Code attached. On my computer, with d2-0.5.0, I got the following output while testing. andrei 0 andrei andrei 1

Re: string comparison

2010-12-19 Thread Denis Koroskin
Check your client setting, everything is perfect on my side (Opera built-in news client).

string comparison

2010-12-18 Thread doubleagent
Andrei's quick dictionary illustration [in his book, 'The D Programming Language'] doesn't seem to work. Code attached. On my computer, with d2-0.5.0, I got the following output while testing. andrei 0 andrei andrei 1 andrei Also, why doesn't 'splitter' show up on the site's