ethar turky
asked on
var split
Dear all ,
I use this
for new line its not working as expected.
I use this
.split(lineSeperator);
to split based on passed variable from user input, its work fine , but when user use '\n'for new line its not working as expected.
ASKER
yes its a new line
ASKER
even \r\n don't work
ASKER
btw, when I use
its work fine...
.split('\n');
its work fine...
I think this is why your previous question showed the optional carriage return ( \r? ). The standard line terminator under Windows is carriage-return/line-feed ( \r\n ). Not everyone follows this, though. Sometimes you have to make either optional in order to match against target data. In your case, I think you are looking for the optional carriage return, so I would modify your example to:
.split('\r?\n');
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
In HTML it's <br>; otherwise, try to use vbCrlf instead of the text \n.
ASKER
none work,
its not html
@ Rainer Jescho, I have the data in text box
its not html
@ Rainer Jescho, I have the data in text box
Can you attach a sample of the text as a file so that we can see what you are working with?
ASKER
Rainer Jeschor, could you please explain why?
Open in new window
Therefore, make sure the character is indeed a newline versus a carriage return as well as not both.