I need to split the below string:
line.long 0x0 " MIDR, Identity Code Register"
I have used space , as the delimiters.
the code should give output in such a way that
Command Name: line
Size: long
Offset : 0x0
short name: MIDR
Long name=Identity code register.
The problem is since i have used space as a delimiter. i need a code in such a way that it should not consider space as a delimiter while splittin the string inside a " " quotes..
can any one help me please..
if (strLine.startsWith("line"))
{
strLine = strLine.substring(0, (strLine.length()-1));
String[] stringSplit = strLine.split("['. ,']");
System.out.println("Command Name: "+stringSplit[0].trim());
System.out.println("Size: "+stringSplit[1].trim());
System.out.println("Offset : "+stringSplit[2].trim());
System.out.println("Short Name : "+stringSplit[3].trim());
System.out.println("Long Name : "+stringSplit[4].trim()+stringSplit[5].trim());
carCount = 1;
linecount = 0;
}