Monday, March 26, 2012

String.ToUpper

Hi,

I have a string 'hello world'

I can UCase my string using String.ToUpper

Is there anyway to just UCase teh first letter ofe ach
word?

Thanks,
Keeri.Define word. Is McDonald's one word? So would the proper casing be
Mcdonald's? And O'Hare would be O'hare? Or should it be Mcdonald'S and
O'Hare (words separated by non-alpha characters instead of white space
characters).

The short answer is - no. It will all depend on your definition of word.

Jerry

"Kerri" <anonymous@.discussions.microsoft.com> wrote in message
news:015c01c39bf6$92670130$a301280a@.phx.gbl...
> Hi,
> I have a string 'hello world'
> I can UCase my string using String.ToUpper
> Is there anyway to just UCase teh first letter ofe ach
> word?
> Thanks,
> Keeri.
This will do what you want
StrConv("hello world", VbStrConv.ProperCase)

"Kerri" <anonymous@.discussions.microsoft.com> wrote in message
news:015c01c39bf6$92670130$a301280a@.phx.gbl...
> Hi,
> I have a string 'hello world'
> I can UCase my string using String.ToUpper
> Is there anyway to just UCase teh first letter ofe ach
> word?
> Thanks,
> Keeri.

0 comments:

Post a Comment