explain internally how split and contains methods works for String <p>I just did some work around and suprised by the result. Let me explain it.</p> <pre><code>String str = "aaa.jpg"; String[] str1 = str.split("."); //output of this is empty array with size 0 str.contains("."); //output of this is true. </code></pre> <p>can anyone explain, why <code>split()</code> method unable to recognize the <code>"."</code>, where as <code>contains()</code> can recognize the <code>"."</code>.</p>