Hi Friends đź‘‹,
Welcome To Infinitbility! ❤️
Today, we are going to do how I find lowercase letters in a string, here we will use some common regex to find all lowercase letters from a string.
Here, we will learn to check whether lowercase letter contains in string or not also, and if contain it will return as a string and array format.
To remove lowercase letters from the string we will use the javascript
replace()
method and it will return the rest lowercase letter in the type of string.To find the lowercase letter in string and return it in the form array we will use the javascript
match()
method.
Let’s plan out what we are going to do in this tutorial.
- Find lowercase letters and get them in string
- Find lowercase letters and get in array
Let’s start today’s tutorial How to find lowercase letters in a string javascript?
Find lowercase letters and get in the string
In this example, To find lowercase letters we will use regex and javascript replace()
method.
1const str = "InfinitBility";23const upperStr = str.replace(/[A-Z]/g, '');4console.log(upperStr); // 👉️ 'nfinitility'
In the above example, we replace uppercase letters with empty and return the rest strings.
The Output should show nfinitility
only. let’s check it.

Find lowercase letters and get in array
In this example, To find lowercase letters we will use the regex and javascript match()
method to get the rest string in an array.
1const str = "InfinitBility";23const upperStrArr = str.match(/[^A-Z]/g, '');4console.log(upperStrArr); // 👉️ [ 'n', 'f', 'i', 'n', 'i', 't', 'i', 'l', 'i', 't', 'y' ]
In the above example, we find lowercase letters in the string and returning char in the array.
The Output should show [ 'n', 'f', 'i', 'n', 'i', 't', 'i', 'l', 'i', 't', 'y' ]
only. let’s check it.

I hope it’s help you, All the best 👍.
Follow me on Twitter
Join our email list and get notified about new content
No worries, I respect your privacy and I will never abuse your email.
Every week, on Tuesday, you will receive a list of free tutorials I made during the week (I write one every day) and news on other training products I create.