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

Popular posts from this blog

ios - Change Storyboard View using Seague -

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -