Courses / JavaScript
47. String.prototype.substring()
Returns the part of the string between the two specified indices.
1 min read Chapter 47 of 99
JavaScript
String.prototype.substring()
String.prototype.substring() extracts a portion of a string between two specified indices.
"I need to get a specific part of a string without manually slicing it every time."
String.prototype.substring() takes two arguments and returns the part of the string between those indices. If the first index is greater than the second, it swaps them.
"I need to get a specific part of a string without manually slicing it every time."
String.prototype.substring() takes two arguments and returns the part of the string between those indices. If the first index is greater than the second, it swaps them.