I am receiving a countless long string from client like “1 15/8/2012 15:00 palak paneer 2 200 dam aaloo 2 100” and so my requirement is I want this string in a table format like:
1"""""""""""""""""""""" '''''''''''''''''''''''''''''''''''''''''''' 15/8/2012 15:00
palak paneer """"""""""""" 2 """"""""""""""""" 200
dam aaloo ''''''''''''''''''''''''''' 2 '''''''''''''''''''''''''''' 100
and so on.
Any help would be appreciated.
What should I use in order to put a whole string into table format and I don’t know the length of string, so we can not use hard coded values.
I have tried the string.split function and I have got an array of strings but as I said the length of string is not fixed so we can not do hard coding so what should I have used?
This is my attempt:
recieved =modifiedSentence.split("~");
int length = 0;
length = recieved.length;
modifiedSentence = modifiedSentence.substring(length);
String string =String.format("%+s %+4s",recieved[0],recieved[1]);
this code might help you, it splits up the
receivedstring to rows.