title: How to create a custom string and populate it dynamically?
body: <p>I'm making an app that can add from button click some items to a <code>recyclerView</code> formatted as "<em>name / quantity / price</em>" and after i click a button called "<strong>Print</strong>" it's save my StringBuilder made from different items added to <code>recyclerView</code> and send it via FTP to a printer.</p>
  
  <p>For now it's working right but i have now to add swipe to delete to the <code>recyclerView</code> and i'll have problems with deleting <code>StringBuilder</code> that corresponds to the <strong>exact item</strong> from the <code>recyclerView</code>.</p>
  
  <p>Do you have any suggestion on how can i do to make that custom string by adding items to the <code>recyclerView</code> and on swipe delete also the corresponding string?</p>
  
  <p>Here is my <code>onClick</code> method where i add the items to the <code>recyclerView</code> and also add the items to the <code>stringBuilder</code> "<em>scontrino</em>" that have to be formatted as you can see on the method with all that "" etc...</p>
  
  <pre><code>    mAdapter.setOnItemClickListener(new Adapter.OnItemClickListener() {
          @SuppressLint("SetTextI18n")
          @Override
          public void onItemClick(final int position) {
  
              double prezzoScont;
  
              itemCassas.add(new ItemCassa(filteredList.get(position).getDeskS(),filteredList.get(position).getQuant(),filteredList.get(position).getPrice()));
  
  
                  prezzo = (prezzo + (filteredList.get(position).getPrice()));
  
  
              scontrino
                      .append("&lt;SELLITEM&gt;").append("\n")
                      .append("&lt;DESCRIPTION&gt;").append(filteredList.get(position).getDeskS()).append("&lt;/DESCRIPTION&gt;").append("\n")
                      .append("&lt;QUANTITY&gt;").append(filteredList.get(position).getQuant()).append("&lt;/QUANTITY&gt;").append("\n")
                      .append("&lt;PRICE&gt;").append(new DecimalFormat("#0.00").format(filteredList.get(position).getPrice())).append("&lt;/PRICE&gt;").append("\n")
                      .append("&lt;/SELLITEM&gt;").append("\n");
  
  
              price.setText(String.valueOf(new DecimalFormat("#0.00").format(prezzo)));
              exampleAdapter.notifyItemInserted(itemCassas.size());
              mRecyclerViewTOP.scrollToPosition(itemCassas.size() - 1);
  
          }
      });
  </code></pre>
  
  <p>Here is a screenshot of what's happening in my app</p>
  
  <p><a href="https://i.stack.imgur.com/dki2i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dki2i.png" alt="screenshot"></a></p>