I have a string that needs to be cast into a date. In IE, my string has an unknown character in it, and it says invalid date when I cast it.
When I run
var dateString = $('#DueDate').val()
for(var i = 0; i < dateString.length; i++){console.log(dateString[i]);}
this is the output:
// empty line that I can't format in Stack overflow correctly
0
1
/
0
1
/
2
0
1
2
And dateString.length
outputs 15
. These characters cannot be spaces because dateString.valueOf()
outputs "01/01/2012"
Also, if I copy and paste where these special characters should be from the control itself into the IE console, the Developer tools window freezes.... If I backspace from the control in the right places, it works fine (presumably because the special characters aren't there anymore). How can I search for and remove this character?