Click to See Complete Forum and Search --> : Is there a way?


Detroit man
May 8th, 2003, 09:46 AM
Hi all,

Just want to know if there is a function where you call with a string and it gives you back a string whith the first letter in upper case and all the others in lower case

EX:Sending:aSdEEr

Returning:Asdeer

Thanks guys

DSJ
May 8th, 2003, 12:49 PM
Sure... here it is:

Private Function CapFirst(ByVal s As String) As String
Dim First As String
Dim Rest As String
First = s.Substring(0, 1)
Rest = s.Substring(1)
Return First.ToUpper & Rest.ToLower
End Function

Detroit man
May 8th, 2003, 01:20 PM
Thanks i owe you one