Use toUpperCase() or toLowerCase() to standardise your string before testing it.

Answer from Nemesis on Stack Overflow
🌐
Esdiscuss
esdiscuss.org › topic › case-insensitive-string-startswith-contains-endswith-replaceall-method
Case insensitive String startsWith, contains, endsWith, replaceAll method
February 18, 2013 - Le 17/02/2013 00:58, Biju a écrit : > In most time when user want to search something in a text, he/she > wants to do a case insensitive search. > For example to filter items displayed in list on a page. > Also on other applications, say any word processor, or in page search > in Firefox, IE, Chrome etc. > > So can we make the default behavior of new methods String.startsWith, > String.contains, String.endsWith case insensitive?
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › startsWith
String.prototype.startsWith() - JavaScript - MDN Web Docs
This method lets you determine whether or not a string begins with another string. This method is case-sensitive. ... const str = "To be, or not to be, that is the question."; console.log(str.startsWith("To be")); // true console.log(str.startsWith("not to be")); // false console.log(str.s...
🌐
Vultr Docs
docs.vultr.com › javascript › standard library › string › startswith()
JavaScript String startsWith() - Check String Start
November 14, 2024 - Remember that startsWith() is case-sensitive: It's crucial to consider this when dealing with user inputs or data from various sources. Implement a basic case-insensitive check using toLowerCase() or toUpperCase().
🌐
HCL Software
help.hcl-software.com › dom_designer › 9.0.1 › reference › r_wpdr_standard_string_startswithignorecase_r.html
startsWithIgnoreCase (JavaScript)
The following example compares the start of a string against a substring ignoring case. This comparison is true. var cities = new String("Paris Moscow Tokyo"); if (cities.startsWithIgnoreCase("paris")) return "Starts with Paris"; else return "Does not start with Paris"
🌐
Tim Mousk
timmousk.com › blog › javascript-startswith
StartsWith() In JavaScript – How to check if a string starts with X? – Tim Mouskhelichvili
March 11, 2023 - To make the startsWith() function case insensitive you will need to make both the value and the searchValue lowercase. javascriptconst str = "This is a very long string!".toLowerCase(); const searchValue = "THis".toLowerCase(); // This will ...
🌐
MSR
rajamsr.com › home › top 5 javascript startswith() alternative methods
Top 5 JavaScript startsWith() Alternative Methods | MSR - Web Dev Simplified
January 28, 2024 - The startsWith() in JavaScript is case-sensitive by default. You must take extra steps to work in case insensitive mode, either by using string lowercase or uppercase methods.
🌐
GoLinuxCloud
golinuxcloud.com › home › programming › javascript › javascript startswith(): check if a string starts with text
How to use JavaScript startsWith() Method? [SOLVED]
June 17, 2026 - startsWith() checks whether a JavaScript string begins with a specific substring. It returns true or false and is case-sensitive.
Find elsewhere
🌐
W3Schools
w3schools.com › jsref › jsref_startswith.asp
JavaScript String startsWith() Method
The startsWith() method is case sensitive. The endsWith() Method · string.startsWith(searchValue, start) JavaScript Strings · JavaScript String Methods · JavaScript String Search · startsWith() is an ECMAScript6 (ES6 2015) feature.
🌐
Explainedsimply
explainedsimply.io › javascript-startswith-method-explained
JavaScript startsWith() Method Explained Simply |
August 28, 2025 - // Solution: Convert to lowercase ... version: function startsWithIgnoreCase(str: string, searchString: string, position?: number): boolean { return str.toLowerCase().startsWith(searchString.toLowerCase(), position); } ...
🌐
Vultr Docs
docs.vultr.com › javascript › examples › check-whether-a-string-starts-and-ends-with-certain-characters
JavaScript Program to Check Whether a String Starts and Ends With Certain Characters | Vultr Docs
November 11, 2024 - In this example, even though str starts with "hello", because startsWith() is case-sensitive and "Hello" is not exactly the same as "hello", the result is false.
🌐
JavaScript Tutorial
javascripttutorial.net › home › javascript string methods › string.prototype.startswith()
JavaScript String startsWith() Method
November 3, 2024 - The startsWith() method always performs a case-sensitive search, so the following statement returns false:
🌐
DEV Community
dev.to › moazamdev › stringstartswith-in-javascript-3bbf
String.startsWith() in JavaScript - DEV Community
January 3, 2023 - The String.prototype.startsWith() ... This method is case-sensitive, meaning that it will return true only if the search string exactly matches the beginning of the target string....
🌐
Js-obfuscator
js-obfuscator.com › article › 27255827.html
Understanding the String.prototype.startsWith Method in JavaScript
##### Example 1: Basic Usage ```javascript let str = "Hello, World!"; console.log(str.startsWith("Hello")); // true console.log(str.startsWith("world")); // false ``` In this example, the string `"Hello, World!"` starts with `"Hello"`, so the first `console.log` statement outputs `true`. However, since the case is important in JavaScript strings, `"world"` does not match, hence the second `console.log` statement outputs `false`. ##### Example 2: Specifying Starting Position ```javascript let str = "Hello, World!"; console.log(str.startsWith("o", 7)); // true console.log(str.startsWith("o", 8)); // false ``` Here, the starting position is specified as `7`, which means the search will begin after the 7th character.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-check-if-a-string-startswith-another-string-in-javascript
JavaScript - How to Check if a String "StartsWith" Another String in JavaScript? - GeeksforGeeks
August 5, 2025 - ... let s = 'Hello World'; let ... is met, otherwise false. This method is case-sensitive and takes an optional second parameter to specify the position in the string to start the search....
🌐
W3Schools
www-db.deis.unibo.it › courses › TW › DOCS › w3schools › jsref › jsref_startswith.asp.html
JavaScript String startsWith() Method
Note: The startsWith() method is case sensitive. ... Color Converter Google Maps Animated Buttons Modal Boxes Modal Images Tooltips Loaders JS Animations Progress Bars Dropdowns Slideshow Side Navigation HTML Includes Color Palettes Code Coloring ... Your message has been sent to W3Schools.
🌐
Linux Tip
linuxscrew.com › home › programming › javascript › the startswith() method for javascript strings [examples]
The startsWith() Method for JavaScript Strings [Examples]
May 28, 2022 - let test = 'Use the Force, Luke.' test.startsWith('Use the); // true test.startsWith('the Force'); // false test.startsWith('the Force', 4); // true
🌐
DEV Community
dev.to › onlinemsr › -top-5-javascript-startswith-alternative-methods-with-examples-48mm
Top 5 JavaScript startsWith() Alternative Methods With Examples - DEV Community
October 3, 2023 - JavaScript String startsWith() method determines whether a string starts with the specific string and returns true if the string begins with characters from another string, otherwise returns false. JavaScript startsWith() method is case sensitive.