๐ŸŒ
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.
๐ŸŒ
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.
Discussions

string - javascript substring - Stack Overflow
the most darndest thing! the following code prints out 'llo' instead of the expected 'wo'. i get such surprising results for a few other numbers. what am i missing here? alert('helloworld'.substri... More on stackoverflow.com
๐ŸŒ stackoverflow.com
What is the most efficient way to find substrings in strings?
Easiest solution is to just use the 'in' operator like this: if "Leonardo DiCaprio" in article_title: return True And according to the top answer here it's also the fastest: whats-a-faster-operation-re-match-search-or-str-find Edit:cant get that return statement to indent for the life of me, you get the idea More on reddit.com
๐ŸŒ r/learnpython
22
5
January 11, 2022
How to remove last word from string in JavaScript
Maybe not the most preferred method but splice the string using spaces, remove the last index on the returned array, then rejoin the array indexes back together . . . Or probably better way is to just use lastIndexOf string method for a space, and then create a substring from the beginning to that index . . . someString = someString.substring(0, someString.lastIndexOf(" ")) More on reddit.com
๐ŸŒ r/learnjavascript
3
0
December 13, 2021
Why do we have a String.slice() method in JS ?
https://stackoverflow.com/a/2243835 This answer outlines the commonalities and differences between the two. More on reddit.com
๐ŸŒ r/learnjavascript
3
2
May 26, 2021
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript โ€บ javascript-string-substring-method
JavaScript String substring() Method - GeeksforGeeks
The substring() method is used to extract a portion of a string. It returns a new string without changing the original one. Extracts characters between two given indices.
Published: January 16, 2026
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ javascript โ€บ substring
JavaScript Substring Method: Learn String Extraction
The substring() method in JavaScript extracts a portion of a string and returns it as a new string without modifying the original string.
๐ŸŒ
freeCodeCamp
freecodecamp.org โ€บ news โ€บ javascript-substring-examples-slice-substr-and-substring-methods-in-js
JavaScript Substring Examples - Slice, Substr, and Substring Methods in JS
March 22, 2020 - This method basically gets a part of the original string and returns it as a new string. The substring method expects two parameters: ... Letโ€™s see the usage in an example. Suppose that we have the example string below: const myString = "I am learning JavaScript and it is cool!";
๐ŸŒ
Refine
refine.dev โ€บ home โ€บ blog โ€บ tutorials โ€บ javascript substring method
JavaScript Substring Method | Refine
January 1, 2025 - JavaScript substring() is a String method that is typically used to extract and store part of a string. During the extraction, the original string remains intact, and the target part is returned as a new string.
๐ŸŒ
Edureka
edureka.co โ€บ blog โ€บ javascript-substring
JavaScript Substring() | How is it different from substr() & slice()? | Edureka
January 9, 2025 - The substring() is an inbuilt function in JavaScript which returns a part of the given string from start index to end index. The indexing starts from zero.
๐ŸŒ
JavaScript Tutorial
javascripttutorial.net โ€บ home โ€บ javascript string methods โ€บ string.prototype.substring()
JavaScript Substring(): Extract a Substring from a String
November 3, 2024 - Then the substring returns the domain that starts from the index of @ plus 1 to the end of the string. The JavaScript substring() method returns the substring from the start index up to and excluding the end index.
Find elsewhere
๐ŸŒ
Tabnine
tabnine.com โ€บ home โ€บ how to use the substring method in js
How to Use the substring Method in JS - Tabnine
July 25, 2024 - In the example above, the substring() method is used to extract the portions of the string str between index 11 (which is included in the result) and index 18 (which is not included). The substring() method returns a new string as its result. Note: JavaScript strings are immutable, meaning that a new string is created in memory for the return value of substring().
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ javascript โ€บ substring
JavaScript | Substring | Codecademy
May 29, 2025 - The .substring() method in JavaScript extracts a portion of a string from one position to another (exclusive) and returns a new string.
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ javascript โ€บ i5foejaa โ€บ javascript-substring-example
How do I get a substring from a string in JavaScript?
August 26, 2026 - To get a substring from a string in JavaScript, you can use the built-in string.substring(start, end) method.
๐ŸŒ
W3Schools
w3schools.com โ€บ jsref โ€บ jsref_substr.asp
JavaScript String substr() Method
The substr() method is removed (deprecated) in the latest JavaScript standard.
๐ŸŒ
Medium
medium.com โ€บ @natarajanck2 โ€บ ๏ธ-substring-in-javascript-clean-cuts-from-your-strings-37d39fd34599
โœ‚๏ธ Substring in JavaScript: Clean Cuts from Your Strings
October 8, 2025 - In JavaScript, the substring() method is an easy way to cut out a portion of a string without changing the original.
๐ŸŒ
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 within the string.
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ javascript-substring
JavaScript substring Function
August 7, 2026 - The JavaScript substring function is one of the String function, which is used to extract the part of a string and return in new one.
๐ŸŒ
Tim Mousk
timmousk.com โ€บ blog โ€บ javascript-substring
Substring() In JavaScript โ€“ How to extract part of a string? โ€“ Tim Mouskhelichvili
March 11, 2023 - In JavaScript, to extract part of a string, you need to use the substring() function, or one of its alternatives.
๐ŸŒ
John Kavanagh
johnkavanagh.co.uk โ€บ home โ€บ articles โ€บ javascript string manipulation: substring() vs. substr()
JavaScript String Manipulation: substring() vs . substr()
November 23, 2022 - As simply as possible: String.prototype.substring() is a JavaScript method which returns a substring, produced by passing in an original string, and two indices which define where the substring should begin and end.
๐ŸŒ
Intellipaat
intellipaat.com โ€บ home โ€บ blog โ€บ javascript substring() method: syntax, examples & use cases
JavaScript substring(): How to Extract Substrings Easily in JS
October 14, 2025 - Working with strings is a core part of being a web developer. From managing forms, handling user input, or cleaning up data, the use cases are many. Luckily, JavaScript provides a built-in substring() method, which is designed to manipulate strings dynamically with ease.