While substr enables negative indices, substring treats them as 0, extracting from the beginning of the string.