Computer Science, asked by Kanandpatel4242, 10 months ago

What is the difference between substr() and substring() in JavaScript?

Answers

Answered by mrsolver2912
0

The difference is in the second argument. The second argument to substring is the index to stop at (but not include), but the second argument to substr is the maximum length to return. Moreover, substr() accepts a negative starting position as an offset from the end of the string. substring() does not.

Similar questions