I have a example String: abcd $cvzasd$ waedqwe$qewrerw$dsaxcz $dasdasd$ $fowjew$ dsadsa
. The $ sign is my delimiter. And I want split this String, but not removing delimiter $. I want at result list with following 8 elements:
abcd, $cvzasd$, waedqwe, $qewrerw$, waedqwe, dsaxcz, $dasdasd$, $fowjew$, dsadsa
How I can't get that result? It's possible, create regex for that? I found a good example: Java: Split String with Regex without deleting delimiters but this not satisfy me because in example use delimiters < and > and it works only for different delimiter.
Otherwise I found a solution with replace my sign by adding to my sign additional sign. Example replace $ by -$ and split by -. But I think is not good solution for me.