🌐
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 ...
🌐
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.
🌐
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.
🌐
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().
Find elsewhere
🌐
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.
🌐
Edureka
edureka.co › blog › javascript-substring
JavaScript Substring() | How is it different from substr() & slice()? | Edureka
January 9, 2025 - For example, “Welcome to Edureka” ... The substring() is an inbuilt function in JavaScript which returns a part of the given string from start index to end index....
🌐
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
🌐
GeeksforGeeks
geeksforgeeks.org › javascript-string-substring-method
JavaScript String substring() Method | GeeksforGeeks
November 28, 2024 - If only the starting index is provided, substring() will return the substring from that index to the end of the string. ... Like most string methods in JavaScript, substring() does not alter the original string.
🌐
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.
🌐
Refine
refine.dev › home › blog › tutorials › javascript substring method
JavaScript Substring Method | Refine
December 31, 2024 - We'll learn how to use JavaScript substring method to extract substrings from a parent string.