I have a project in Java, which collects data from a Linux machine and gets output like this:
SwapCached: 0 kB
I need to split this sentence into this words:
SwapCached,0
I know how to split by single characters, but don't know how to split with multiple words(like kB) and multiple spaces together.
EDIT: I tried this one but it didn't clear the spaces.
bolunmus[i]=line.split(":|\\ +|\\ |kB");
splittakes a regex.String.replace()followed by.split()?