CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Is there a way?

  1. #1
    Join Date
    Jan 2003
    Posts
    31

    Is there a way?

    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

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    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

  3. #3
    Join Date
    Jan 2003
    Posts
    31
    Thanks i owe you one

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured