how to store and display multiline text in firestore

Viewed 1235

when i store data using

  <vs-textarea  v-model="textarea" label=" Description "  rows="5"  />                

e.g.

       abc
       def
       geh

the data is stored in the firestore in the format of string

abc def geh

and same is displayed when retrieved using

 <vs-collapse>
                <vs-collapse-item>
                    <div slot="header">Read More</div>  
                   {{ jobDetails.description }}

                    </vs-collapse-item>
            </vs-collapse>

how can i store multiline text in firestore ?

2 Answers

Just format the text with your own delimiter and then split it back. Example:

The quick brown fox^jumps over the lazy dog

Here I use the ^ character as delimiter. Now just use a split like:

import java.util.regex.Pattern;

Pattern pattern = Pattern.compile("^");
String[] result = pattern.split(INPUT_STRING);
Related