Finding a specific string in a list

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have the following list:



l="apple","orange","kiwi","APPLE","lemon"


How can I make a command so the capitalised word would be returned?
So in this case the output should be



"APPLE"


Surely one can do l[[4]] but this is not what I am looking for, I want to have a command to search on a long list and return the capital words. Also note that in my case the whole word is in capital letter not only the first letter. Also assume that I don't know what would be the capital word, I just know that I have a list and somewhere in it there is a capitalised letter word, I need to find those.










share|improve this question

























    up vote
    1
    down vote

    favorite












    I have the following list:



    l="apple","orange","kiwi","APPLE","lemon"


    How can I make a command so the capitalised word would be returned?
    So in this case the output should be



    "APPLE"


    Surely one can do l[[4]] but this is not what I am looking for, I want to have a command to search on a long list and return the capital words. Also note that in my case the whole word is in capital letter not only the first letter. Also assume that I don't know what would be the capital word, I just know that I have a list and somewhere in it there is a capitalised letter word, I need to find those.










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have the following list:



      l="apple","orange","kiwi","APPLE","lemon"


      How can I make a command so the capitalised word would be returned?
      So in this case the output should be



      "APPLE"


      Surely one can do l[[4]] but this is not what I am looking for, I want to have a command to search on a long list and return the capital words. Also note that in my case the whole word is in capital letter not only the first letter. Also assume that I don't know what would be the capital word, I just know that I have a list and somewhere in it there is a capitalised letter word, I need to find those.










      share|improve this question













      I have the following list:



      l="apple","orange","kiwi","APPLE","lemon"


      How can I make a command so the capitalised word would be returned?
      So in this case the output should be



      "APPLE"


      Surely one can do l[[4]] but this is not what I am looking for, I want to have a command to search on a long list and return the capital words. Also note that in my case the whole word is in capital letter not only the first letter. Also assume that I don't know what would be the capital word, I just know that I have a list and somewhere in it there is a capitalised letter word, I need to find those.







      list-manipulation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 36 mins ago









      William

      42827




      42827




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          l = "apple", "orange", "kiwi", "APPLE", "lemon", "Lemon", "leMon";
          Select[l, UpperCaseQ]



          "APPLE"







          share|improve this answer




















          • Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
            – J. M. is somewhat okay.♦
            27 mins ago










          • @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
            – kglr
            21 mins ago

















          up vote
          1
          down vote













          Try



          Select[l, StringMatchQ[__?UpperCaseQ]]





          share|improve this answer






















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "387"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183678%2ffinding-a-specific-string-in-a-list%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            l = "apple", "orange", "kiwi", "APPLE", "lemon", "Lemon", "leMon";
            Select[l, UpperCaseQ]



            "APPLE"







            share|improve this answer




















            • Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
              – J. M. is somewhat okay.♦
              27 mins ago










            • @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
              – kglr
              21 mins ago














            up vote
            2
            down vote



            accepted










            l = "apple", "orange", "kiwi", "APPLE", "lemon", "Lemon", "leMon";
            Select[l, UpperCaseQ]



            "APPLE"







            share|improve this answer




















            • Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
              – J. M. is somewhat okay.♦
              27 mins ago










            • @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
              – kglr
              21 mins ago












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            l = "apple", "orange", "kiwi", "APPLE", "lemon", "Lemon", "leMon";
            Select[l, UpperCaseQ]



            "APPLE"







            share|improve this answer












            l = "apple", "orange", "kiwi", "APPLE", "lemon", "Lemon", "leMon";
            Select[l, UpperCaseQ]



            "APPLE"








            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered 31 mins ago









            kglr

            164k8188388




            164k8188388











            • Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
              – J. M. is somewhat okay.♦
              27 mins ago










            • @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
              – kglr
              21 mins ago
















            • Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
              – J. M. is somewhat okay.♦
              27 mins ago










            • @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
              – kglr
              21 mins ago















            Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
            – J. M. is somewhat okay.♦
            27 mins ago




            Ah, I need to recalibrate my gedanken Mathematica; I didn't know that plain UpperCaseQ will still work! :)
            – J. M. is somewhat okay.♦
            27 mins ago












            @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
            – kglr
            21 mins ago




            @J.M. my gedanken mma would have tried #==ToUpperCase[#]&:)
            – kglr
            21 mins ago










            up vote
            1
            down vote













            Try



            Select[l, StringMatchQ[__?UpperCaseQ]]





            share|improve this answer


























              up vote
              1
              down vote













              Try



              Select[l, StringMatchQ[__?UpperCaseQ]]





              share|improve this answer
























                up vote
                1
                down vote










                up vote
                1
                down vote









                Try



                Select[l, StringMatchQ[__?UpperCaseQ]]





                share|improve this answer














                Try



                Select[l, StringMatchQ[__?UpperCaseQ]]






                share|improve this answer














                share|improve this answer



                share|improve this answer








                answered 28 mins ago


























                community wiki





                J. M. is somewhat okay.




























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f183678%2ffinding-a-specific-string-in-a-list%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery