convert strings into Lower case and Upper case in javascript

by Developer 25. January 2010 08:53

There are no functions available in javascript to converts strings into Upper case letters or into Lower case letters. You can easily do this in jQuery.

jQuery provides us two different functions to convert inot Upper case and to convert into Lower case.

 

In the below code we are converting array items into upper case and lower case.

 

<html>
    <head>
        <title>javascript arrays using map(),toUpperCase(),toLowerCase() jQuery functions</title>
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                //converting array elemenst to Upper case
                var elems = ['Asp.Net', 'Vb.Net', 'C#.Net', 'Asp.Net MVC', 'Sharepoint']
                elems = $.map(elems, function(n, i) { return (i + 1 + "." + n.toUpperCase()); });
                $('#divtoUpper').html(elems.join("<br />"));

                //converting array elemenst to Lower case
                var elems1 = ['Asp.Net', 'Vb.Net', 'C#.Net', 'Asp.Net MVC', 'Sharepoint']
                elems1 = $.map(elems1, function(n, i) { return (i + 1 + "." + n.toLowerCase()); });
                $('#divtoLower').html(elems1.join("<br />"));
               
            });   
        </script>
    </head>
    <body>
      <p>Array Elements using map() & toUpperCase() jQuery functions</p>
      <div id="divtoUpper"></div>
      <p>Array Elements using map() & toLowerCase() jQuery functions</p>
      <div id="divtoLower"></div>
    </body>
</html>

 

Here we are using three different functions map(), toUpperCase() and toLowerCase() functions.

 

In my previous post I explain about map() function.

toUpperCase() function converts any string into upper case.

toLowerCase() function converts any string into lower case.

 

n.toUpperCase() will convert array item "n" into upper case.

n.toLowerCase() will convert array item "n" into lower case.

 

Download source code: UpperCase_LowerCase.zip (35.84 kb)

Comments

5/3/2010 5:19:21 AM #

Koh Phangan Hotels

Totally agree with your words. Awesome Blog Google referred me to.
Warmest greetings from Italy

Koh Phangan Hotels

5/7/2010 12:29:30 AM #

Sherilyn Zook

Hello blogger, good morning. Wonderful post. You have gained a new reader. Pleasee continue this awesome work and I look forward to more of your superb articles.

Sherilyn Zook

5/16/2010 6:11:39 AM #

Clorinda Penner

it is my first post on this web and at first I would like to thank for the great quality information, which I were able to find in this and all previous posts , it really helped me a lot. I will definitely iclude this website on my rss reader :) Also, I would like to ask - don't you mind if I will quate some information from your blog because I am writing articles for the Bukisa, Ezine and other articles directories (this is my part time job)? It would really help me with some of mine articles. Of course, I will mention your website title or URL (not all articles directories allows URL's , so I can't 100% promise that you will get a direct backlink to your blog).

Clorinda Penner

5/20/2010 1:26:23 AM #

how to make gold in an hour wow

If you're still on the fence: grab your favorite earphones, head down to a Best Buy and ask to plug them into a Zune then an iPod and see which one sounds better to you, and which interface makes you smile more. Then you'll know which is right for you.

how to make gold in an hour wow

5/24/2010 8:53:50 PM #

Hypercom T7Plus Manual

OK, 1st it needs to be said that convert strings into Lower case and Upper case in javascript is well done and we need more sites like it.  Not to get off on any tangents but health insurance reform, earth quakes, cheating celebs, I need an escape. I escape by reading blogs like this. Peace out.

Hypercom T7Plus Manual

5/26/2010 10:50:55 PM #

Das Millionenquiz

Easily, the article is in reality the best on this noteworthy topic. I fit in with your conclusions and will eagerly look forward to your  forthcoming updates. Saying thanks will not just be sufficient, for the great clarity in your writing. I will at once grab your rss feed to stay privy of any updates. Good work and much success in your business enterprize!

Das Millionenquiz

5/27/2010 4:02:16 PM #

Top 10 interview questions

Do you do any other sites other than convert strings into Lower case and Upper case in javascript?  It's like Hells Kitchen with Ramsey.  I mean he's with this cooks and merchants and they just dont even know how to run their businesses.  Ya know?

Top 10 interview questions

5/30/2010 1:09:02 AM #

Lionel Warmbier

I usually don’t post in Blogs but your blog forced me to, amazing work... beautiful...

Lionel Warmbier

6/9/2010 2:43:03 PM #

Merchant Service Providers

You're right about your article convert strings into Lower case and Upper case in javascript. I will certainly be reading your website more.
Take care

Merchant Service Providers

6/18/2010 10:03:22 AM #

Laureen Trompeter

Thanks for this informational post.I am very new on web development and so will certainly pursue for the fallowing ones. Have a awsome day.

Laureen Trompeter

6/22/2010 2:29:20 PM #

Verifone Manual

Blog Engine FTW! convert strings into Lower case and Upper case in javascript is cool.  I am really interested and was wondering if anyone else had any other related posts they would suggest. I like writing squidoo lenses myself and would like to gather as much data as I can. Please take a look one of my little projects if you like

Verifone Manual

7/7/2010 7:17:19 PM #

Hoyt Shoat

pls extra photoes

Hoyt Shoat

7/7/2010 7:18:13 PM #

Malik Petruccelli

go figure :-|:)}

Malik Petruccelli

7/9/2010 6:19:46 AM #

male enhancement

Exactly what about middle aged guys who still have sex daily? I think there are less of us out there. Sounds like a few guys require a little bit of assist, in addition to a kick in the butt to get working on it.

male enhancement

7/9/2010 2:40:56 PM #

Olen Donelson

Perhaps you have considered adding up extra video clips to your blog posts to hold the visitors further entertained? I mean I just read through the whole piece of yours and it had been completely enjoyable but since I'm more of a visual learner,I found that for being further helpful well let me know how it turns out! I enjoy what you guys are always up too. Such bright work and reporting! Maintain the great works guys I've added you guys to my blogroll. This is a great article thanks for sharing this informative information.. I'll visit your blog regularly for some latest post.

Olen Donelson

7/12/2010 8:50:22 AM #

engagement rings

White gold is usually my favorite, it holds up really well.

engagement rings

7/12/2010 2:36:42 PM #

Hoyt Schegetz

this is just what I was trying to find

Hoyt Schegetz

7/12/2010 10:42:58 PM #

Vern Bellis

Hey, good day. Great post. You've gotten gained a brand new reader. Pls stick with it and I look forward to extra of your glorious blog posts. Greets, Jessica.

Vern Bellis

7/30/2010 9:02:26 PM #

Austin Dingwall

Maby considere to write a convert string into upper case in javascript company to put here adv

Austin Dingwall

Add comment




  Country flag

Click to change captcha
biuquote
  • Comment
  • Preview
Loading



Page List

    Tag cloud