Does D has C#'s string.Empty?

2014-09-24 Thread AsmMan via Digitalmars-d-learn
Does D has C#'s string.Empty?

Re: Does D has C#'s string.Empty?

2014-09-24 Thread Daniel Kozak via Digitalmars-d-learn
V Thu, 25 Sep 2014 05:29:36 + AsmMan via Digitalmars-d-learn napsáno: > Does D has C#'s string.Empty? string.init

Re: Does D has C#'s string.Empty?

2014-09-24 Thread SlomoTheBrave via Digitalmars-d-learn
On Thursday, 25 September 2014 at 06:41:55 UTC, Daniel Kozak via Digitalmars-d-learn wrote: V Thu, 25 Sep 2014 05:29:36 + AsmMan via Digitalmars-d-learn napsáno: Does D has C#'s string.Empty? string.init first ^^

Re: Does D has C#'s string.Empty?

2014-09-24 Thread SlomoTheBrave via Digitalmars-d-learn
On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote: Does D has C#'s string.Empty? string.init ? string a; a = string.init; assert( a == ""); does the job for the type string at least.

Re: Does D has C#'s string.Empty?

2014-09-25 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/25/14 2:41 AM, SlomoTheBrave wrote: On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote: Does D has C#'s string.Empty? string.init ? string a; a = string.init; assert( a == ""); does the job for the type string at least. null also wor

Re: Does D has C#'s string.Empty?

2014-09-25 Thread AsmMan via Digitalmars-d-learn
On Thursday, 25 September 2014 at 06:41:03 UTC, SlomoTheBrave wrote: On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote: Does D has C#'s string.Empty? string.init ? string a; a = string.init; assert( a == ""); does the job for the type

Re: Does D has C#'s string.Empty?

2014-09-25 Thread AsmMan via Digitalmars-d-learn
On Thursday, 25 September 2014 at 12:43:57 UTC, Steven Schveighoffer wrote: On 9/25/14 2:41 AM, SlomoTheBrave wrote: On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote: Does D has C#'s string.Empty? string.init ? string a; a = string.init; asse

Re: Does D has C#'s string.Empty?

2014-09-25 Thread ketmar via Digitalmars-d-learn
On Fri, 26 Sep 2014 00:24:27 + AsmMan via Digitalmars-d-learn wrote: > It made me a bit confusing. How is the implementation of string > comparasion in D? "" has length of 0. null has length of 0. two strings without content are essentialy the same. signature.asc Description: PGP signature

Re: Does D has C#'s string.Empty?

2014-09-25 Thread AsmMan via Digitalmars-d-learn
On Friday, 26 September 2014 at 00:53:24 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 26 Sep 2014 00:24:27 + AsmMan via Digitalmars-d-learn wrote: It made me a bit confusing. How is the implementation of string comparasion in D? "" has length of 0. null has length of 0. two strings

Re: Does D has C#'s string.Empty?

2014-09-25 Thread ketmar via Digitalmars-d-learn
On Fri, 26 Sep 2014 01:08:59 + AsmMan via Digitalmars-d-learn wrote: > but null has length? what's null in D? no, it's dynamic array that have `.length`. compiler magic. assigning `null` to dynamic array variable does some magic under the hood. dynamic array is actually this: `struct { size_

Re: Does D has C#'s string.Empty?

2014-09-25 Thread ketmar via Digitalmars-d-learn
On Fri, 26 Sep 2014 01:08:59 + AsmMan via Digitalmars-d-learn wrote: > > "" has length of 0. null has length of 0. two strings without > > content > > are essentialy the same. > but null has length? what's null in D? i confused you here, sorry. what i mean is 'null string', not 'null' as a t

Re: Does D has C#'s string.Empty?

2014-09-25 Thread Chris Cain via Digitalmars-d-learn
On Friday, 26 September 2014 at 01:09:01 UTC, AsmMan wrote: On Friday, 26 September 2014 at 00:53:24 UTC, ketmar via Digitalmars-d-learn wrote: On Fri, 26 Sep 2014 00:24:27 + AsmMan via Digitalmars-d-learn wrote: It made me a bit confusing. How is the implementation of string comparasi

Re: Does D has C#'s string.Empty?

2014-09-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/25/14 8:24 PM, AsmMan wrote: On Thursday, 25 September 2014 at 12:43:57 UTC, Steven Schveighoffer wrote: On 9/25/14 2:41 AM, SlomoTheBrave wrote: On Thursday, 25 September 2014 at 05:29:37 UTC, AsmMan wrote: Does D has C#'s string.Empty? string.init ? string a;

Re: Does D has C#'s string.Empty?

2014-09-26 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Sep 26, 2014 at 02:01:22PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: > On 9/25/14 8:24 PM, AsmMan wrote: [...] > >It made me a bit confusing. How is the implementation of string > >comparasion in D? (if someone could point to actual code used in > >these comparasion would