mardi 31 mars 2015

How to split a string without losing any word?

I was using eclipse for Java.


I want to split an input line without losing any char.


For example input line is:

IPOD6 1 USD6IPHONE6 16G,64G,128G USD9,USD99,USD999MACAIR 2013-2014 USD123MACPRO 2013-2014,2014-2015 USD899,USD999


output:

IPOD6 1 USD6

IPHONE6 16G,64G,128G USD9,USD99,USD999

MACAIR 2013-2014 USD123

MACPRO 2013-2014,2014-2015 USD899,USD999



I was using split("(?<=\bUSD\d{1,99}+)")

but it does't work


Aucun commentaire:

Enregistrer un commentaire