function to increment a numerical string