samedi 23 novembre 2019

How to split a String and keep the delimiter '='

I have a string like this

String s = "p=YSp%hZ5=YunnYDUuGxVxAeLCZuVvSfoutO8=";
String[] array = s.split("=");

This array will give me an an output like this: p, YSp%hZ5, YunnYDUuGxVxAeLCZuVvSfoutO8

Desired would be to have those elements but keep the = sign like: p=, YSp%hZ5=, YunnYDUuGxVxAeLCZuVvSfoutO8=

I need to split it by = sing and keep the '=' sign somehow. Does anyone knows some pattern which will help me with it.

Aucun commentaire:

Enregistrer un commentaire