[Gambas-user] string operator ==

Werner wdahn at ...1000...
Wed Nov 10 13:48:08 CET 2010


On 10/11/10 20:38, Caveat wrote:
> Thanks for the (as usual) speedy reply Benoit.
>
> You are right that the == operator is not often used.  I have just
> double-checked that the = operator does work as intended (phew!).  My
> only fear is that I may have introduced an == somewhere, purely out of
> habit as a java programmer.
>
> I'll hold off on shipping anything out of the current 2.19 I have, to be
> on the safe side. :-)
>
> Just out of curiosity, is there a difference between = and == when
> working with strings?
> In java, = is an assignment and == means "are these 2 things the same
> object?".  If you want to compare strings, you have to use the ugly and
> ungainly "some string".equals("some other string") method, which breaks
> horribly if your string is null... ho hum!
>
> Regards,
> Caveat
>   
The == comparison is not case sensitive

Werner





More information about the User mailing list