java - Why String.contains with empty String returns true? -
when work code found this,
string mystring1="foo"; string mystring2=""; if(mystring1.contains(mystring2)){ system.out.println("am here"); } else{ system.out.println("am not here"); }
it print am here
why? please 1 me find this.
it same principle empty set subset of every possible set.
Comments
Post a Comment