Allow the position range (in str_sub()
) to be 0 <= pos <= str->length
#151
Labels
TODO
It hasn't implemented yet.
str_sub()
) to be 0 <= pos <= str->length
#151
Followup
Sorry I've missed it in the last review, We should allow the position range to be 0 <= pos <= str->length
when the pos == 0 the user can still get a substring of length zero.
The position should be added to the length check, if the length of the substring starting at the pos exceeded the string length it would be an error. (see below)
TODO:
I'm not expecting it from this pr but it's worth mentioning.
Make the length argument as optional to let the users allow get substring starting from pos to the reset of the string.
The text was updated successfully, but these errors were encountered: