lib/string: use indexed access to chars instead of iterators

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>