pgSplitToArray

Hi Clifton,
I think I may have found a problem in this function but, on the other hand, I may be asking too much of it.
I often use the $ character like this: var secs = 25; var txt = 'You will have $ seconds to do this task.'; txt = tbfunction_pgReplace('$', '$', txt); result: You will have 25 seconds to do this task. No problem.
I tried to use pgSplitToArray on a sentence like that and it would seem to be dysfunctional. Try this:
var txt = "How are you $ doing today?';
var myArray = txt.split("$");
alert (myArray[0] + "\n" + myArray[1]);
result:
How are you
doing today?
var myArray2 = tbfunction_pgSplitToArray("$", txt)
alert (myArray2[0] + "\n" + myArray2[1]);
result:
$
undefined
I then tried this:
var txt = "How are you and how are doing today?';
var myArray == tbfunction_pgSplitToArray("and", txt)
alert (myArray[0] + "\n" + myArray[1]);
result:
and
undefined
It's not a problem for me and maybe I'm missing someting obvious but you might want to take a look at it.
John
I think I may have found a problem in this function but, on the other hand, I may be asking too much of it.
I often use the $ character like this: var secs = 25; var txt = 'You will have $ seconds to do this task.'; txt = tbfunction_pgReplace('$', '$', txt); result: You will have 25 seconds to do this task. No problem.
I tried to use pgSplitToArray on a sentence like that and it would seem to be dysfunctional. Try this:
var txt = "How are you $ doing today?';
var myArray = txt.split("$");
alert (myArray[0] + "\n" + myArray[1]);
result:
How are you
doing today?
var myArray2 = tbfunction_pgSplitToArray("$", txt)
alert (myArray2[0] + "\n" + myArray2[1]);
result:
$
undefined
I then tried this:
var txt = "How are you and how are doing today?';
var myArray == tbfunction_pgSplitToArray("and", txt)
alert (myArray[0] + "\n" + myArray[1]);
result:
and
undefined
It's not a problem for me and maybe I'm missing someting obvious but you might want to take a look at it.
John