Stack Overflow
stackoverflow.com › questions › 3745515 › what-is-the-difference-between-substr-and-substring
javascript - What is the difference between substr and substring? - Stack Overflow
What is the difference between alert("abc".substr(0,2)); and alert("abc".substring(0,2)); They both seem to output “ab”.
What is Difference between SUBSTR(), MID(), SUBSTRING() in SQL?
in SQL? they're all identical perhaps instead of "SQL" you meant "Microsoft SQL SERVER"??? More on reddit.com
When I can't remember the difference between slice, splice, substr and substring
Who needs consistency anyways. Somebody should tell the people that make JS standards that just because all other languages already use "start,length" they don't necessarily had to pick "start,end" More on reddit.com
If you could only use string.slice or string.substring, which string method would you choose?
.slice() seems to have become more popular. Advantages: Accepts negative values as parameters. Same name as Array.protoype.slice() Differences between the two: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substring#Differences_between_substring_and_slice More on reddit.com
String.{substr, substring, splice}: which to use?
The header says substr, substring and splice
but the content talks about String.prototype.slice
Nice to point out the substr vs substring differences though!
More on reddit.comr/angularjs on Reddit: Difference between substring and substr ...
09:26
JavaScript Substring vs. Substr: Which One Should You Use? (String ...
07:07
Difference Between slice, substring and substr method Javascript ...
11:45
Difference between substring and substr in JavaScript | Javascript ...
17:05
Mindluster - Learn Substring in JavaScript | Substring vs Substr ...
05:15
Javascript Tutorial 37: substring, substr and slice
John Kavanagh
johnkavanagh.co.uk › home › articles › javascript string manipulation: substring() vs. substr()
JavaScript String Manipulation: substring() vs . substr()
November 23, 2022 - When in doubt, prefer substring() for its consistency with the standard and its predictable, standardised behaviour. When refactoring legacy code, don't simply swap substr() out for substring() without paying close attention to the parameters. Add a clap for this article.1,3951,395 claps so far. ... Solving the LeetCode Two Sum Problem Using JavaScript.
Mastering JS
masteringjs.io › tutorials › fundamentals › substring
Substring vs Substr vs Slice in JavaScript - Mastering JS
June 20, 2019 - The substring() function is the most common way to get a substring in JavaScript. It takes two parameters: indexStart and indexEnd. It returns the portion of the string that starts at indexStart and ends the character immediately preceding indexEnd.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › substring
String.prototype.substring() - JavaScript - MDN Web Docs
The substring() method of String values returns the part of this string from the start index up to and excluding the end index, or to the end of the string if no end index is supplied.
Jim Nielsen's Blog
blog.jim-nielsen.com › 2019 › difference-between-substr-and-substring-in-javascript
The Difference Between substring and substr in JavaScript - Jim Nielsen’s Blog
January 4, 2019 - 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.
DigitalOcean
digitalocean.com › community › tutorials › js-substring-vs-substr
substring vs substr in JavaScript | DigitalOcean
November 6, 2017 - substr() method is very similar, but the second argument is not for the end index, it’s for the amount of characters.
Stack Abuse
stackabuse.com › bytes › difference-between-substr-and-substring-in-javascript
Difference Between substr() and substring() in JavaScript
September 13, 2023 - The substr() method in JavaScript is used to extract parts of a string, starting from the index specified and extending for a given number of characters afterwards.
W3docs
w3docs.com › home › code snippets › javascript › what is the difference between substr and substring
What is the Difference Between Substr and Substring | W3docs
Both methods can take two parameters, but <kbd class="highlighted">substr()</kbd> uses a start index and a length, while <kbd class="highlighted">substring()</kbd> uses a start index and an end index (excluding).
Ditectrev
blog.ditectrev.com › blog › software-development › web-development › frontend › javascript › slice-vs-substring-vs-substr-complete-javascript-string-methods-comparison
slice() vs substring() vs substr(): Complete JavaScript String Methods Comparison | 📝 Ditectrev Blog | #Build Your Digital Future.
January 12, 2026 - Unlike slice(), substring() has some quirky behaviors that can lead to unexpected results, making it less intuitive for many developers. substring() was one of the earliest string methods in JavaScript (since ES1) and has legacy behaviors that were kept for backward compatibility.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › substr
String.prototype.substr() - JavaScript - MDN Web Docs
1 week ago - The substr() method of String values returns a portion of this string, starting at the specified index and extending for a given number of characters afterwards.
To The New
tothenew.com › home › technology › javascript : string.slice() vs string.substring() vs string.substr()
JavaScript : String.slice() vs String.substring() vs String.substr() | TO THE NEW Blog
August 29, 2016 - Same with substring and substr also. const result = name.substring(1) // ‘ipin’ const result = name.substr(1) // ‘ipin’ ... Great! You have drawn a very good comparison of the various methods to slice up strings in JavaScript.