java regex pipe problem

I was trying to split a string to an array. and the special character was | (pipe).

String[] incomings=income.split("|");

and here is the out for income="abcd|efg"


then I understand that this pipe char turns this issue an regex one and doing some strange stuff :) after some research I found the solution. here is the solution for regex pipe


this makes the output for same situation like this:




Popular posts from this blog

Next (2007)

Postgresql group by day, week and month examples