Forum Discussion
Using Javascript i tire the below options,
1)
mycellvalue.split("\r\n")
2)
var testRE = RegExp("\r\n");
mycellvalue.split(testR)
3)
mycellvalue.split(chr(13);
nothing is working for me..
I haven't tried it myself, but have you looked into the aqString.Split() method? That is not using native JavaScript but an internal function of TestComplete so it MIGHT work differently.
- shankar_r10 years agoCommunity Hero
I guess instead of aqString.Split() we should use aqString.GetListItem() after setting up the aqString.ListSeparator.
I have tried that too.
aqString.ListSeparator = "\r\n"
aqString.GetListItem(mycellvalue,0);
aqString.ListSeparator = chr(13)
aqString.GetListItem(mycellvalue,0);but no luck.
- Colin_McCrae10 years agoCommunity Hero
Does "Replace" work?
It's what I tend to use to remove line feeds & carriage returns. (My use case is slightly different to yours, I want rid of them!)
I'm not a JavaScript guy, but it has that method apparently?
http://www.w3schools.com/Jsref/jsref_replace.asp
So if you did:
<YOUR-STRING> = <YOUR-STRING>.Replace(chr(10), "");
<YOUR-STRING> = <YOUR-STRING>.Replace(chr(13), "");
... are you left with one big long line of all the text from the cell?
I "replace" out these characters all the time (in VBScript & C# Script) no problem.
- tristaanogre10 years agoEsteemed Contributor
Here's a question:
Everything you've tried to date to parse out those carriage returns SHOULD work... the question, I guess, is... Are they REALLY carriage returns? I mean, the data entry into Excel makes it LOOK that way, but are there other characters going on there that we need to know more about?
Let me poke around a bit and I'll let you know but I suspect that we may be on the right track but looking for the wrong character