[TASK] Use $x[n] instead of substr($x, n, 1)

Change-Id: Ib58894a67f0292b9d62da81511ce12d3f16590ef
Resolves: #55445
Releases: 6.2
Reviewed-on: https://review.typo3.org/27136
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind