Apply "Name" Case to A String

mpappert

Regular
Joined
Oct 5, 2002
Messages
58
Location
Ottawa, ON, Canada
Again, another post to see if there is a better means for doing this ... I am taking a name such as "ashlyn" and making it read "Ashlyn" ...

Visual Basic:
    m_strFirstName = UCase$(Left$(m_strFirstName,1)) & Right$(m_strFirstName, Len(m_strFirstName) -1)

Thanks,
M.
 
The ToTitleCase function of the TextInfo class can be used to
convert a string to Title Case (aka Proper Case), as so:

Visual Basic:
Dim cinfo As New Globalization.CultureInfo("en-US")

m_strFirstName = cinfo.TextInfo.ToTitleCase(m_strFirstName)
 
Back
Top