Use `charAt` to improve semantics

This commit does not change any functionality,
but it does make the code a tad more descriptive.

Using [`String.prototype.substr`][1] to check for
containing strings might confuse novice developers,
therefore it is substituted with
[`String.prototype.charAt`][2] from now on.
from now on.

[1]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr
[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/charAt