Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. => operator in C#

=> operator in C#

Scheduled Pinned Locked Moved C#
csharphelplearning
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    trinh nguyen
    wrote on last edited by
    #1

    I am new to C#, so any one can help me to understand the => operator in C# or give me some resource on this. Thanks in advanced.

    A X R L 4 Replies Last reply
    0
    • T trinh nguyen

      I am new to C#, so any one can help me to understand the => operator in C# or give me some resource on this. Thanks in advanced.

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      This (=>) is called the Lambda operator. This will help you generate lambda expressions. You specify input parameters (if any) on the left side of the lambda operator =>, and you put the expression or statement block on the other side. For example, the lambda expression x => x * x specifies a parameter that’s named x and returns the value of x squared.

      Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

      T 1 Reply Last reply
      0
      • A Abhinav S

        This (=>) is called the Lambda operator. This will help you generate lambda expressions. You specify input parameters (if any) on the left side of the lambda operator =>, and you put the expression or statement block on the other side. For example, the lambda expression x => x * x specifies a parameter that’s named x and returns the value of x squared.

        Apps - Color Analyzer | Arctic | XKCD | Sound Meter | Speed Dial

        T Offline
        T Offline
        trinh nguyen
        wrote on last edited by
        #3

        Thanks Abhinav S so much!

        1 Reply Last reply
        0
        • T trinh nguyen

          I am new to C#, so any one can help me to understand the => operator in C# or give me some resource on this. Thanks in advanced.

          X Offline
          X Offline
          XoulsZ
          wrote on last edited by
          #4

          The => operator in C# is for an example if your int is equals or more then the other int. I hope this help :D //XoulsZ

          B 1 Reply Last reply
          0
          • X XoulsZ

            The => operator in C# is for an example if your int is equals or more then the other int. I hope this help :D //XoulsZ

            B Offline
            B Offline
            Bernhard Hiller
            wrote on last edited by
            #5

            No, that's wrong. Let me tell you: => != >= !

            1 Reply Last reply
            0
            • T trinh nguyen

              I am new to C#, so any one can help me to understand the => operator in C# or give me some resource on this. Thanks in advanced.

              R Offline
              R Offline
              Rahul Rajat Singh
              wrote on last edited by
              #6

              It has something to do with Lambda expressions. It is the syntax for lambda expressions in C#. For more details read this: A Beginner's Tutorial on Basics of Delegates, Anonymous Functions and Lambda Expressions in C#[^]

              Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.

              1 Reply Last reply
              0
              • T trinh nguyen

                I am new to C#, so any one can help me to understand the => operator in C# or give me some resource on this. Thanks in advanced.

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                reference link: http://msdn.microsoft.com/en-us/library/vstudio/bb397687.aspx[^] -Amir Mohammad Nasrollahi

                /* LIFE RUNS ON CODE */

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups