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

Answer from Nemesis on Stack Overflow
🌐
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...
🌐
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.
Discussions

java - How to use `string.startsWith()` method ignoring the case? - Stack Overflow
It checks whether the region of needle from index 0 till length 5 is present in haystack starting from index 0 till length 5 or not. The first argument is true, means it will do case-insensitive matching. More on stackoverflow.com
🌐 stackoverflow.com
How to make code in JS case insensitive?
Transform the string to a known case first and then compare against a string with the same case. More on reddit.com
🌐 r/learnprogramming
5
5
April 3, 2021
javascript - Regex to check whether string starts with, ignoring case differences - Stack Overflow
I need to check whether a word starts with a particular substring ignoring the case differences. I have been doing this check using the following regex search pattern but that does not help when th... More on stackoverflow.com
🌐 stackoverflow.com
Case insensitive using startswith
maybe str.lower().str.startswith() would work? More on reddit.com
🌐 r/learnpython
6
1
May 13, 2020
🌐
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 - You can use the startsWith() method ... names. 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...
🌐
Esdiscuss
esdiscuss.org › topic › case-insensitive-string-startswith-contains-endswith-replaceall-method
Case insensitive String startsWith, contains, endsWith, replaceAll method
February 18, 2013 - And sometimes, case-sensitive is what you want. I agree, that is why I mentioned to add matchCase parameter. or have startsWithI, containsI, endsWithI instead
🌐
Vultr Docs
docs.vultr.com › javascript › standard library › string › startswith()
JavaScript String startsWith() - Check String Start
November 14, 2024 - JAVASCRIPT · Copy · const input = "Today is sunny."; const search = "today"; const caseInsensitiveCheck = input.toLowerCase().startsWith(search.toLowerCase()); console.log(caseInsensitiveCheck); Explain Code · Powered by Vultr AgentBeta · This adjustment ensures the comparison disregards case differences, thus, "Today is sunny." starts with "today" under a case-insensitive logic.
🌐
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"
Find elsewhere
🌐
SheCodes
shecodes.io › athena › 37854-how-to-ignore-case-in-javascript
[JavaScript] - How to ignore case in JavaScript? - SheCodes | SheCodes
Learn how to perform case-insensitive comparisons in JavaScript using toLowerCase(), toUpperCase(), and regular expressions with the i flag.
🌐
npm
npmjs.com › package › case-insensitive
case-insensitive - npm
February 26, 2017 - A Node.js module that wraps around an array or string and transforms certain methods into case-insensitive versions.
      » npm install case-insensitive
    
Published: Feb 26, 2017
Version: 1.0.0
Author: John Lamansky
🌐
W3Schools
w3schools.com › jsref › jsref_startswith.asp
JavaScript String startsWith() Method
The startsWith() method returns true if a string starts with a specified string.
🌐
Reddit
reddit.com › r/learnprogramming › how to make code in js case insensitive?
r/learnprogramming on Reddit: How to make code in JS case insensitive?
April 3, 2021 -

Ok so here’s an example of my code: if (message.content.startsWith(“k beg”)) {

Basically, the code will work but the user must type in exactly “k beg” all lowercase. I want the code to be case insensitive (for example (K bEg), AND the message content should be just the input, so “k beg” shouldn’t trigger when it’s in the middle of a sentence.

One of my major points though is to make it case insensitive, so if anyone can help with just that, I’ll be happy. Thank you.

🌐
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:
🌐
30 Seconds of Code
30secondsofcode.org › home › javascript › string › case-insensitive substring search
Can I check if a JavaScript string contains a substring, regardless of case? - 30 seconds of code
May 25, 2024 - In order to do so, you'll have to use the RegExp() constructor to create a regular expression that matches the given searchString, ignoring the case. Then, you can use the RegExp.prototype.test() method to check if the string contains the substring. ...
🌐
Programiz
programiz.com › javascript › library › string › startswith
Javascript String startsWith()
let check = sentence.startsWith("Java"); console.log(check); // true let check1 = sentence.startsWith("Java is"); console.log(check1); // true // case sensitive · let check2 = sentence.startsWith("JavaScript"); console.log(check2); // false // second argument specifies the starting position
🌐
SamanthaMing
samanthaming.com › tidbits › 67-es6-startswith-method
String startsWith() Method in JavaScript | SamanthaMing.com
Proof again, don't think you can ... this in a future tidbit 😜 · One important thing to keep in mind is the startWith method is case sensitive....
🌐
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....
🌐
Medium
medium.com › dailyjs › string-startswith-method-in-javascript-b12ec998eb54
String startsWith() Method in JavaScript | by Samantha Ming | DailyJS | Medium
August 8, 2019 - const name = 'Samantha Ming';name.startsWith('S'); // true name.startsWith('M'); // false ... Frontend Developer sharing weekly JS, HTML, CSS code tidbits🔥 Discover them all on samanthaming.com 💛 ... JavaScript news and opinion.