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. Web Development
  3. ASP.NET
  4. Characters before @

Characters before @

Scheduled Pinned Locked Moved ASP.NET
comquestion
8 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.
  • S Offline
    S Offline
    saurabh mohal
    wrote on last edited by
    #1

    I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

    C B A B 4 Replies Last reply
    0
    • S saurabh mohal

      I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      The Text property gives you the string. IT's a string, it has methods for finding characters. Or you can use a RegEx, if you want, but it's not needed to just find the @. I'd use the split method for that.

      Christian Graus Driven to the arms of OSX by Vista.

      S 1 Reply Last reply
      0
      • C Christian Graus

        The Text property gives you the string. IT's a string, it has methods for finding characters. Or you can use a RegEx, if you want, but it's not needed to just find the @. I'd use the split method for that.

        Christian Graus Driven to the arms of OSX by Vista.

        S Offline
        S Offline
        saurabh mohal
        wrote on last edited by
        #3

        Sorry i dint get your ans can u describe me using some example..!!

        C C 2 Replies Last reply
        0
        • S saurabh mohal

          I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

          B Offline
          B Offline
          Brij
          wrote on last edited by
          #4

          Textbox returns string.You can use split function.

          Cheers!! Brij

          1 Reply Last reply
          0
          • S saurabh mohal

            I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

            A Offline
            A Offline
            Abhijit Jana
            wrote on last edited by
            #5

            saurabh mohal wrote:

            I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

            I didn't get your point.:confused: You want something MaskedTextbox (in Windows Form)

            cheers, Abhijit My Recent Article : Beginner's Guide to ASP.NET Application Folder

            1 Reply Last reply
            0
            • S saurabh mohal

              Sorry i dint get your ans can u describe me using some example..!!

              C Offline
              C Offline
              ChandraRam
              wrote on last edited by
              #6

              Christian has already given you the key words to search for "string" and "split" - now you should probably look in your book or google for it.

              1 Reply Last reply
              0
              • S saurabh mohal

                Sorry i dint get your ans can u describe me using some example..!!

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #7

                If you're incapable of using google or exploring the methods on the string class using intellisense, perhaps the world has lost a janitor without gaining a programmer ?

                Christian Graus Driven to the arms of OSX by Vista.

                1 Reply Last reply
                0
                • S saurabh mohal

                  I have for e.g saurabh@yahoo.com in Textbox i only want characters before @ i.e saurabh. What should be the property for textbox to do this..?

                  B Offline
                  B Offline
                  Blue_Boy
                  wrote on last edited by
                  #8

                  Well, Christian gived you answer but I will give you too example. string email = textBoxName.Text.Substring(0,textBoxName.Text.IndexOf("@"));


                  I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.

                  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