VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Gets the Initials from a name in a string variable, it also accepts a delimiter such as . or if y

by Humberto Martinez (2 Submissions)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 5th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Gets the Initials from a name in a string variable, it also accepts a delimiter such as "." or if you prefer no delimiter just send ""

Rate Gets the Initials from a name in a string variable, it also accepts a delimiter such as . or if y



Dim CCount As Integer
Dim I as integer
Dim Cur As String
Dim BolInit As Boolean
Dim strInitials As String

CCount = Len(Trim(Name))
BolInit = True

For I = 1 To CCount

    Cur = Mid(Name, I, 1)
    
    If BolInit Then
        strInitials = strInitials & Cur & Delimiter
        BolInit = False
    End If
    
    If Cur = " " Then BolInit = True
    
Next I
Initials = strInitials
End Function


Download this snippet    Add to My Saved Code

Gets the Initials from a name in a string variable, it also accepts a delimiter such as . or if y Comments

No comments have been posted about Gets the Initials from a name in a string variable, it also accepts a delimiter such as . or if y. Why not be the first to post a comment about Gets the Initials from a name in a string variable, it also accepts a delimiter such as . or if y.

Post your comment

Subject:
Message:
0/1000 characters