You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
init() is
var s1 = "abcd";
var s2 = "b";
IO.Std.out.println ("substring:" + s1.substring(1,2) + " s2: " + s2);
if s1.substring(1,2) == s2 then
IO.Std.out.println("hit");
else
IO.Std.out.println(">" + s1.substring(1,2) + "< should be equal to >" + s2 + "< but isn't");
fi
si
si
si
The text was updated successfully, but these errors were encountered:
Behaviour of == is similar to Java - for reference types it compares for reference equality only.
=~ is the overridable equality operator, and is defined by the L library for strings, returning true if the strings represent exactly equal sequences of bytes.
Only=~ can be defined, x !~ y returns, by definition, !(x =~ y). This behaviour cannot be overridden.
=~ and !~ are defensive against nulls and will never call the user operator method with a null argument. The compiler generates code around uses of =~ and !~ such that:
namespace TRYOUT is
use System;
use Generic;
// class Main is
si
The text was updated successfully, but these errors were encountered: