Add const for getStringLength() function