-
-
Notifications
You must be signed in to change notification settings - Fork 223
How to get text without \n ? #266
Answered
by
KillyMXI
romanboiko-softserve
asked this question in
Q&A
-
Hi,
I'm using the convert method to transform strings like this: "Item 1 - Gift wrapping: Yes <br />" and getting in result strings like this: "Item 1 - Gift wrapping: Yes \n".
Is there a way to get the string without "\n"?
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
KillyMXI
Dec 5, 2022
This example can have multiple interpretations.
What exactly is the goal?
- remove only trailing whitespace and linebreaks - you can use
trimEnd()after conversion; - ignore all
<br />tags - useselectors: [ { selector: 'br', format: 'skip' } ].
Replies: 1 comment 1 reply
-
This example can have multiple interpretations.
What exactly is the goal?
- remove only trailing whitespace and linebreaks - you can use
trimEnd()after conversion; - ignore all
<br />tags - useselectors: [ { selector: 'br', format: 'skip' } ].
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
I needed to get a result like this: "Item 1 - Gift wrapping: Yes".
trimEnd() helped, thanks.
I just thought there is a build in method for getting the format I needed.
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
romanboiko-softserve
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment