🌐
W3Schools
w3schools.com › jsref › jsref_substring.asp
JavaScript String substring() Method
The substring() method does not change the original string. If start is greater than end, arguments are swapped: (4, 1) = (1, 4). Start or end values less than 0, are treated as 0. ... If you want to use W3Schools services as an educational ...
Spaces
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Academy
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
Practice
Practice coding problems on W3Schools. Write code, submit, and get instant feedback.
Python For Loops
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
W3Schools
w3schools.com › js › js_string_methods.asp
JavaScript String Methods
The substr() method is deprecated in the latest JavaScript standard, but is still officially defined in Annex B of the ECMAScript specification for backward compatibility.
🌐
W3Schools
w3schools.com › jsref › jsref_substr.asp
JavaScript String substr() Method
substr() is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: ❮ Previous JavaScript String Reference Next ❯ · ★ +1 · Sign in to track progress · REMOVE ADS · PLUS · SPACES · GET CERTIFIED · FOR TEACHERS ...
🌐
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
w3schools.com › js › tryit.asp
W3Schools online HTML editor
The W3Schools online code editor allows you to edit code and view the result in your browser
🌐
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.
🌐
W3Schools
w3schools.com › JSREF › tryit.asp
W3Schools Tryit Editor - JavaScript Strings
The W3Schools online code editor allows you to edit code and view the result in your browser
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-substring-method
JavaScript String substring() Method - GeeksforGeeks
EndIndex: Describe the part of the string to be taken as a substring(optional).
Published   January 16, 2026
🌐
Busitema
capfoe.library.busitema.ac.ug › modules › en-w3schools › content › jsref › jsref_substring.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
w3schools.com › jsref › tryjsref_substring.htm
JavaScript Strings
The substring() Method · substring() extracts a part of a string:
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript string methods › string.prototype.substring()
JavaScript Substring(): Extract a Substring from a String
November 3, 2024 - In this tutorial, you'll learn how to use the JavaScript substring() method to extract a substring from a string.
🌐
W3Schools
w3schools.com › java › ref_string_substring.asp
Java String substring() Method
If the end argument is not specified then the substring will end at the end of the string. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com · If you want to report an error, or if you want to make a suggestion, send us an e-mail: help@w3schools.com · HTML Tutorial CSS Tutorial JavaScript ...
🌐
W3Schools
w3schools.com › js › js_string_search.asp
JavaScript String Search
For a complete reference to all JavaScript properties and methods, with full descriptions and many examples, go to: W3Schools' Full JavaScript Reference.
🌐
W3Schools
w3schools.com › jsref › jsref_slice_string.asp
JavaScript String slice() Method
The substring() Method · string.slice(start, end) From position 3 to 8: let result = text.slice(3, 8); Try it Yourself » · Only the first character: let result = text.slice(0, 1); Try it Yourself » · Only the last character: let result = text.slice(-1); Try it Yourself » · The whole string: let result = text.slice(0); Try it Yourself » · JavaScript Strings ·
🌐
W3Schools
w3schools.com › jsref › jsref_sub.asp
JavaScript String sub() Method
String sub() is deprecated in JavaScript. Avoid using it. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: sales@w3schools.com
🌐
Tabnine
tabnine.com › home › how to use the substring method in js
How to Use the substring Method in JS - Tabnine
July 25, 2024 - The substring() method extracts a part of a string from the larger whole. Note: Be careful to not confuse substring() with the substr() method! The example below demonstrates how to use the substring() method to retrieve a portion of a string: ...
🌐
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.