I was expecting the OUTPUT
to be 3
from the below class:
public class Pattern {
public static void main(String[] args) {
String data = "111,577,5099,541,142,
2015-08-01 00:08:42,2015-08-01 06:31:52|
674,898,7061,36,105,2015-08-01 19:28:45,
2015-08-02 14:46:27|948,522,1840,66,889,
2015-08-02 13:04:56,2015-08-02 19:39:57";
if(data.contains("|"))
{
String pattern[] = data.split("|");
System.out.println("the pattern length: "+pattern.length);
}
}
}
OUTPUT:
the pattern length: 180