title: How to Split an ArrayList to get the required data and store it in a String in order to prepare a print command in Android using Java?
body: <p>I would like to print the items in a List using a Bluetooth POS printer from my application.
  I am creating a print command which contains the list of items contained in the List.
  I have converted my list to a string. Now i want to get the only required data from that and i have to append print commands to it.
  For Example: (Below is the sample output of my list which i converted to String)</p>
  
  <pre><code>[{quantity=1, name= C D M roast almond 38g, price=45.0}, {quantity=1, name=Amul cheese 200g, price=105.0}, {quantity=1, name=Bambino roasted vermicelli 170g, price=23.0}, {quantity=1, name=Cadbury shots, price=5.0}, {quantity=1, name=Cherry blk wax 40g, price=51.0}, {quantity=1, name=Clinic plus 175ml, price=95.0}]
  </code></pre>
  
  <p>My Output Should be like below</p>
  
  <pre><code>&lt;LEFT&gt;1 &lt;CENTER&gt;C D M roast almond 38g &lt;RIGHT&gt;45.0&lt;BR&gt;
  &lt;LEFT&gt;1 &lt;CENTER&gt;Amul cheese 200g &lt;RIGHT&gt;105.0&lt;BR&gt;
  &lt;LEFT&gt;1 &lt;CENTER&gt;Bambino roasted vermicelli 170g &lt;RIGHT&gt;23.0&lt;BR&gt;
  &lt;LEFT&gt;1 &lt;CENTER&gt;Cadbury shots &lt;RIGHT&gt;5.0&lt;BR&gt;
  &lt;LEFT&gt;1 &lt;CENTER&gt;Cherry blk wax 40g &lt;RIGHT&gt;51.0&lt;BR&gt;
  &lt;LEFT&gt;1 &lt;CENTER&gt;Clinic plus 175ml &lt;RIGHT&gt;95.0&lt;BR&gt;
  </code></pre>
  
  <p>Here </p>
  
  <p><code>&lt;LEFT&gt;, &lt;RIGHT&gt;, &lt;CENTER&gt;, and &lt;BR&gt;</code>
   are print commands.</p>
  
  <p>I need your help in achieving this.
  Below is the image view
  <a href="https://i.stack.imgur.com/Wju2V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wju2V.png" alt="List items to be Printed in a bill"></a></p>