ADO DOT NET
Centurion
- Joined
- Dec 20, 2006
- Messages
- 160
Hi,
I want to convert the FIRST WORD of my sentence to upper case.
For example:
this is a test string.
Should become:
THIS is a test string.
So I wrote this:
But it returns Index Out of Range !
Anything is wrong with me?
I want to convert the FIRST WORD of my sentence to upper case.
For example:
this is a test string.
Should become:
THIS is a test string.
So I wrote this:
Visual Basic:
Input.Substring(0, Input.IndexOf(" ")).ToUpper + Input.Substring(Input.IndexOf(" "), Input.Length - Input.IndexOf(" "))
Anything is wrong with me?