469,625 Members | 1,687 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Can Format function force upper/lower case?

bob
In vb6 you could say s = Format(s, "!") to force text to upper case in
the format
function. I've searched the vb.net help system and can't find any help
on formatting text. There's plenty of help formatting numbers, dates,
and times, though.

Does the vb.net format function have a way to convert text to upper or
lower case?

Thanks.

Jun 16 '06 #1
3 11216

bo*@datasync.com wrote:
In vb6 you could say s = Format(s, "!") to force text to upper case in
the format
function.
You mean ">", but yes.
I've searched the vb.net help system and can't find any help
on formatting text. There's plenty of help formatting numbers, dates,
and times, though.

Does the vb.net format function have a way to convert text to upper or
lower case?


I had a little look, seems these string formatting features were either
dropped from Format or the docs are particularly well hidden. Two
options:

- Use the old function, as found in Microsoft.VisualBasic.Compatibility
(the use of which is generally advised against, though it makes for the
quickest conversion)
- Change the code to use String.ToUpper (eg just s = s.ToUpper replaces
your snippet)

--
Larry Lard
Replies to group please

Jun 16 '06 #2
bo*@datasync.com wrote:
In vb6 you could say s = Format(s, "!") to force text to upper case in
the format
function. I've searched the vb.net help system and can't find any help
on formatting text. There's plenty of help formatting numbers, dates,
and times, though.

Does the vb.net format function have a way to convert text to upper or
lower case?

Thanks.


Strings are objects, they have their own methods for that
string.ToLower()
and it's counterpart
string.ToUpper()

--
Rinze van Huizen
C-Services Holland b.v
Jun 16 '06 #3
If you are formatting a textbox, use the following:
txtFirstName.CharacterCasing = CharacterCasing.Upper

hth

bill v

<bo*@datasync.com> wrote in message
news:11**********************@u72g2000cwu.googlegr oups.com...
In vb6 you could say s = Format(s, "!") to force text to upper case in
the format
function. I've searched the vb.net help system and can't find any help
on formatting text. There's plenty of help formatting numbers, dates,
and times, though.

Does the vb.net format function have a way to convert text to upper or
lower case?

Thanks.

Jun 17 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by lowellturner | last post: by
17 posts views Thread by Janice | last post: by
2 posts views Thread by tshad | last post: by
19 posts views Thread by Eric Lindsay | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.