W3Schools
w3schools.com › jsref › jsref_substring.asp
JavaScript String substring() Method
More examples below. ... 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.
How do I only replace the first instance of a substring?
Solved. In case you also need it, and you're using regexes: string = string.left(regex_match.get_start()) + (string.right(string.length() - regex_match.get_end())) This basically just adds the string that's to the left of the match to the string that's to the right of it, skipping over it. More on reddit.com
whatIsTheSubstrReplacement
Imagine looking at the doc before calling a function you don't know. More on reddit.com
How do you determine string A contains string B?
This is not necessarily a Vue-related question, but rather JavaScript-related one, so I don't see how this post belongs here. You can use String.prototype.includes method. More on reddit.com
Why is my JSInterop string.contains() method failing?
Isn't it string.includes() ? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes More on reddit.com
17:05
Substring in JavaScript | Substring vs Substr vs Slice Method ...
06:15
slice vs substring method | String Object In JavaScript - YouTube
02:27
JavaScript Basics - substr() - YouTube
13:12
Como funciona o Substring do Javascript - YouTube
05:39
JavaScript Substring Example | Slice, Substr, and Substring Methods ...
GeeksforGeeks
geeksforgeeks.org › javascript › javascript-string-substring-method
JavaScript String substring() Method - GeeksforGeeks
For example, you might extract the first name or last name from a full name string. ... let s1 = "Amit Ray"; let s2 = s1.substring(0, 4); let s3 = s1.substring(5); console.log(s2); console.log(s3); You can use substring() to extract parts of ...
Published: January 16, 2026
TechOnTheNet
techonthenet.com › js › string_substring.php
JavaScript: String substring() method
In this example, we have declared a variable called totn_string that is assigned the string value of 'TechOnTheNet'. We have then invoked the substring() method of the totn_string variable to extract the substring from the 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.
Programiz
programiz.com › javascript › library › string › substring
Javascript String substring()
if (string.substring(i, i + oldChars.length) == oldChars) { string = string.substring(0, i) + newChars + string.substring(i + oldChars.length, string.length); } } return string; } const string = "Java Tutorials"; let newString = replaceString("Java", "JavaScript", string); console.log(newString); ...
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);Copy
Codecademy
codecademy.com › docs › javascript › substring
JavaScript | Substring | Codecademy
May 29, 2025 - This codebyte example uses the .substring() method with the startIndex parameter being greater than endIndex to extract characters from index 0 to index 6 in the str string:
Vultr Docs
docs.vultr.com › javascript › standard library › string › substring()
JavaScript String substring() - Extract Substring Range | Vultr Docs
September 27, 2024 - The script fetches the user's name example by cutting off at the "@" character's index. The substring() method in JavaScript serves as a powerful tool for extracting specified ranges from strings. Its intuitive handling of indices, including adjustments for out-of-bounds values, makes string ...
TutorialsPoint
tutorialspoint.com › javascript › string_substring.htm
JavaScript String substring() Method
<html><head><title>JavaScript String substring() Method</title></head><body><script> const str = "Hypertext Markup Language"; let indexStart = 5; let indexEnd = 16; document.write("Original string: ", str); document.write("<br>Indices are: ", indexStart, ", ", indexEnd); document.write("<br>Extracted string: ", str.substring(indexStart, indexEnd));</script> </body></html>