Re: possible to use Bang ! notation in place of "Not" keyword?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"Rich" <Rich@xxxxxxxxxxxxxxxxxxxxxxxxx> schrieb:
If Not st1.Equals("something") then
Do Something Else
End If

if str1 != "something" Then ...

I realize that != is C# stuff and/or can be also be used in Tsql, but is
there any implementation of bang ! in VB.Net? Just checking. Any samples
appreciated.


Note that C# overloads the '==' and '!=' operators so that they work with both value types and reference types. Thus it's not obious if value equality or object identity is compared. Other programming languages, such as VB, provide different operators for comparing (1) value equality and (2) object identity.

In VB, the operators '=' and '<>' are used to compare for value equality and 'Is' and 'IsNot' (VB 2005) are used to compare for object identity.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

.



Relevant Pages

  • Re: Float comparison
    ... values for equality, but why I cannot use this method? ... Your method is still comparing for equality, ... Oh, and as you consider me to be one of the "regs" I could consider some of the exchanges between you and Kenny as insulting to me, exchanges where the last response was yours agreeing with Kenny. ...
    (comp.lang.c)
  • Re: Comparing fp types for equality
    ... Do the same issues involved in comparing 2 fp types for equality ... The macro normalizes the difference between scalar a and scalar b regarding ...
    (comp.lang.c)
  • Re: linux policeman needed!
    ... comparing a couple of strings because the implementers thought ... Once you have implicit references you have to have two equality ... one for reference equality and one for value equality. ...
    (comp.os.linux.misc)
  • Re: More static type fun.
    ... > Comparing by representation is the roughest approximation imaginable. ... EQ tests object identity. ... EQL tests object identity except for numbers and characters, ... therefore the default equality predicate in every situation I can think ...
    (comp.lang.lisp)
  • Re: Glasgow haskell vs. Lispworks
    ... 'dbenson AT eecs DOT wsu DOT edu' wrote: ... Jon simply has been using the object identity instead of value ... The equality on objects is said to be object ... This is useful to compare ...
    (comp.lang.functional)