Hello, I want to find occurrence of enter key in string using javascript. I mean I am having a string
abc def ghi
then it will find total 3 occurrences of enter key. Please help me how can I do this? Thanks in advance.
Do you mean a line break? Look for \n.
Also note that if this data comes from a Mac (up to OS 9 I believe) user, the line ending will actually be a carriage return (\r).