How to extract a letter from a string
View Single Post
02-21-2013, 11:22 PM
Supreme Master coder!
Join Date: Feb 2009
Thanked 4,308 Times in 4,275 Posts
Looks like your code would have worked if you had used
event.value = str.substring(strt+1,end);
But again, if you only needed the one character, charAt() is easier.
Or you could have used
event.value = str.substr(strt+1,1);
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Users who have thanked Old Pedant for this post:
View Public Profile
Find More Posts by Old Pedant