|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
splitting fullname to an intial and the surname!
can anybody help? how do u split an intial and surname from a full name? can anybody pass the code over? i know its something to do with strings!
|
|
#2
|
||||
|
||||
|
how about showing what you've done and the problems that you are having.
asking for someone to just do it for you is the least likely way to get help. I will give you the two functions that you need to accomplish this though: Split & Mid |
|
#3
|
||||
|
||||
|
Code:
Private Sub Form_Load() Dim strFullName As String Dim strInitial As String Dim strLName As String strFullName = "Thomas Edison" strInitial = Mid(strFullName, 1, 1) & "." strLName = Mid(strFullName, (InStr(strFullName, " ") + 1), (Len (strFullName) - InStr(strFullName, " "))) MsgBox strInitial & strLName End Sub I think that should work, but only in cases where there are only two given names. It should give you a start, anyway.
__________________
Fisherman "Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." - A.Einstein |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > splitting fullname to an intial and the surname! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|