A
A
Alex Mustdie2015-06-12 12:50:11
ActionScript
Alex Mustdie, 2015-06-12 12:50:11

How to replace line break with comma in AS3?

Good day
The user enters some values ​​into the TextArea, separating them with a line break. You need to replace these hyphens with commas.
I tried like this:
JRBpiYR.png
As you can see, everything is in order with 1 and 2, but then it does not react. What to do?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
C
copal, 2015-06-12
@alexmustdie

And is it necessary?
trace(string.replace(/\r/g, ','));

A
Alexander Flasher, 2015-08-27
@alexvoz

sometimes you still need to replace "\n\r" - it depends where the text was typed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question