0

Hello
I have a text-editor (CKEditor one) whereby am retrieving all the texts (which are in 3 paragraphs), in a single string variable, using Java codes.

However, all the 3 paragraphs being retrieved have leading spaces, and I want to remove them for display purposes. How can I do so, using this single variable to hold all the texts, and keeping them formatted on 3 different lines?

Example is (from the CKEditor source)
<p>This is line 1</p>
<p>This is line 2</p>
<p>This is line 3</p>

Edited by Ritesh_4

2
Contributors
1
Reply
9
Views
3 Years
Discussion Span
Last Post by stultuske
1

find all occurrences of </p><p> and replace it by <br/>,
then, check if there are occurences of either <p> or <br/> with a space as next char:

while(spaceNextChar()) removeChar();

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.