W3Schools
w3schools.com › jsref › jsref_substring.asp
JavaScript String substring() Method
The substring() method extracts characters, between two indices (positions), from a string, and returns the substring.
W3Schools
w3schools.com › jsref › jsref_substr.asp
JavaScript String substr() Method
The substr() method is removed (deprecated) in the latest JavaScript standard. Use substring() or slice() instead. ... If you want to use W3Schools services as an educational institution, team or enterprise, send ...
Videos
W3Schools
w3schools.com › js › js_string_methods.asp
JavaScript String Methods
If you omit the second parameter, substring() will slice out the rest of the string. ... The difference is that the second parameter specifies the length of the extracted part. The substr() method is removed (deprecated) in the latest JavaScript standard.
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › jsref › jsref_substring.asp.html
JavaScript String substring() Method
The substring() method extracts the characters from a string, between two specified indices, and returns the new sub string.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › substring
String.prototype.substring() - JavaScript | MDN
If indexEnd is omitted or undefined, substring() extracts characters to the end of the string.
W3Schools Blog
w3schools.blog › home › javascript string substring() method
JavaScript String substring() method - W3schools
June 1, 2019 - Return: Sub string. ... <!DOCTYPE html> <html> <body> <script> var a ="HELLO WORLD!"; document.write(a.substring(0,5)); </script> </body> </html>
W3Schools Blog
w3schools.blog › home › javascript string substr() method
JavaScript String substr() method - W3schools
June 1, 2019 - JavaScript string substr() method retrieves the part of the given string on the basis of the specified starting position and length.
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › substr
String.prototype.substr() - JavaScript | MDN
A string's substr() method extracts length characters from the string, counting from the start index.
W3Schools
w3schoolsua.github.io › js › js_string_methods_en.html
JavaScript String Methods. Examples. Lessons for beginners. W3Schools in English
If you omit the second parameter, the method will slice out the rest of the string: ... The difference is that start and end values less than 0 are treated as 0 in substring().
JavaScript Tutorial
javascripttutorial.net › home › javascript string methods › string.prototype.substring()
JavaScript Substring(): Extract a Substring from a String
November 3, 2024 - The following example uses the substring method to extract a substring starting from the beginning of the string: let str = 'JavaScript Substring'; let substring = str.substring(0,10); console.log(substring);Code language: JavaScript (javascript)
Programiz
programiz.com › javascript › library › string › substring
Javascript String substring()
// if start > end, they are swapped substr2 = string.substring(1, 0); console.log(substr2); // P // From 11th to last character substr3 = string.substring(10); console.log(substr3); // JavaScript Tutorials // the extreme values are 0 and str.length
TechOnTheNet
techonthenet.com › js › string_substring.php
JavaScript: String substring() method
This JavaScript tutorial explains how to use the string method called substring() with syntax and examples. In JavaScript, substring() is a string method that is used to extract a substring from a string, given start and end positions.
W3Schools
w3schools.sinsixx.com › jsref › jsref_substring.asp.htm
JavaScript substring() Method - SinSiXX - W3Schools
Free HTML XHTML CSS JavaScript DHTML XML DOM XSL XSLT RSS AJAX ASP ADO PHP SQL tutorials, references, examples for web building.
TutorialsPoint
tutorialspoint.com › home › javascript › javascript string substring
JavaScript String Substring
September 1, 2008 - Learn how to use the substring method in JavaScript to extract parts of a string efficiently.
W3Schools
w3schools.com › jsref › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
Medium
medium.com › nerd-for-tech › basics-of-javascript-string-substring-method-1083c3d918e2
Basics of Javascript · String · substring() (method) | by Jakub Korch | Nerd For Tech | Medium
June 22, 2021 - If the second parameter is not provided, it extracts substring from starting position till the end. Second case shows a difference when the first parameter is greater than the second parameter. Obviously there is a difference, but unlike slice() that would return an empty string, substr() uses a second parameter to specify length of the substring, so the fact that the second parameter is less than the first parameter causes no issue and we just extract different parts of the string.