I am build an autocomplete that searches off of a CouchDB View.
I need to be able to take the final character of the input string, and replace the last character with the next letter of the english alphabet. (No need for i18n here)
For Example:
- Input String = "b"
- startkey = "b"
- endkey = "c"
OR
- Input String = "foo"
- startkey = "foo"
- endkey = "fop"
(in case you're wondering, I'm making sure to include the option inclusive_end=false
so that this extra character doesn't taint my resultset)
The Question
- Is there a function natively in Javascript that can just get the next letter of the alphabet?
- Or will I just need to suck it up and do my own fancy function with a base string like "abc...xyz" and
indexOf()
?