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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Break Fullname Into First And Last Name

Break Fullname Into First And Last Name

Scheduled Pinned Locked Moved Database
question
7 Posts 5 Posters 1 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.
  • A Offline
    A Offline
    AndyInUK
    wrote on last edited by
    #1

    Hi , How can i break Fullname Into First And Last Name. For instance there is a column with name "Mr James Smith" and i want to break this into 3 columns with Title, FirstName and LastName. Thank You

    A L D 3 Replies Last reply
    0
    • A AndyInUK

      Hi , How can i break Fullname Into First And Last Name. For instance there is a column with name "Mr James Smith" and i want to break this into 3 columns with Title, FirstName and LastName. Thank You

      A Offline
      A Offline
      Andy_L_J
      wrote on last edited by
      #2

      http://www.devx.com/tips/Tip/20009[^]

      I don't speak Idiot - please talk slowly and clearly 'This space for rent' Driven to the arms of Heineken by the wife

      1 Reply Last reply
      0
      • A AndyInUK

        Hi , How can i break Fullname Into First And Last Name. For instance there is a column with name "Mr James Smith" and i want to break this into 3 columns with Title, FirstName and LastName. Thank You

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

        Be carefull with those; some people have no title, but a compound First-name, or a surname that's made up out of multiple names. I'd check the first argument from the string against a known list of titles, just to see whether that part was included or whether it's a first name.

        I are Troll :)

        1 Reply Last reply
        0
        • A AndyInUK

          Hi , How can i break Fullname Into First And Last Name. For instance there is a column with name "Mr James Smith" and i want to break this into 3 columns with Title, FirstName and LastName. Thank You

          D Offline
          D Offline
          dan sh
          wrote on last edited by
          #4

          Given the various kinds of name people have in various parts of world, you can not be sure that your code will work fine. It will irritate one person with different kind of name. Still, you can have something predefined like: 1. First two words will go in as first name. 2. Last word will be the Last name. 3. Rest can be treated as middle name. Beware, Sean Claude Van Dam will be angry by this approach.

          It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

          J 1 Reply Last reply
          0
          • D dan sh

            Given the various kinds of name people have in various parts of world, you can not be sure that your code will work fine. It will irritate one person with different kind of name. Still, you can have something predefined like: 1. First two words will go in as first name. 2. Last word will be the Last name. 3. Rest can be treated as middle name. Beware, Sean Claude Van Dam will be angry by this approach.

            It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

            J Offline
            J Offline
            J4amieC
            wrote on last edited by
            #5

            d@nish wrote:

            Sean Claude Van Dam

            Jean

            L D 2 Replies Last reply
            0
            • J J4amieC

              d@nish wrote:

              Sean Claude Van Dam

              Jean

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

              J4amieC wrote:

              Jean

              I think Sean is the Irish one :laugh:

              1 Reply Last reply
              0
              • J J4amieC

                d@nish wrote:

                Sean Claude Van Dam

                Jean

                D Offline
                D Offline
                dan sh
                wrote on last edited by
                #7

                I wasn't sure about the spelling. Hence I checked in google and got the results. Although I did not bothered to look down the page.

                It's not necessary to be so stupid, either, but people manage it. - Christian Graus, 2009 AD

                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