Per controllare le stringhe:
substr
concat
indexOf

cerca questo sulla guida...