Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

I need a function that convert the first letter of each input word to upper case.

I have written this one:

   Private Function FirstWordUp(ByVal Input As String) As String
       FirstWordUp = Input.Substring(0, Input.IndexOf(" ")).ToUpper + Input.Substring(Input.IndexOf(" "), Input.Length - Input.IndexOf(" "))
   End Function

But however, this only converts the first letter of the first word to upper case.

The problem is that I usually become very confused when working with such string operations! :confused:

Is anyone able to help me to complete this function?

Any idea?

Thanks:)

Posted

Thanks a lot, it was great! :)

Just one more question: I need both converting the first letter of each word to upper case and lower case.

This do the trick for uppercase, you know what should I do for lower case?

Thank you.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...