|
-
Mar 16th, 2002, 05:41 PM
#1
Thread Starter
Frenzied Member
FYI - You can use VB specific functions in any C# project
I just realized that you can use vb specific functions in C#.
I am writing a CD cataloging program and all the title name were upper case in the Database.
I was looking for a function to convert the titles to proper case and unfortunately C# does not have a function to convert strings to proper case, so I had to use the on from VB.NET.
by using
using Microsoft.VisualBasic; or just qualifying the entire name space to use the function like this
Microsoft.VisualBasic.Strings.StrConv
.Net is off the hook
Dont gain the world and lose your soul
-
Mar 16th, 2002, 06:11 PM
#2
Frenzied Member
c# does have the function
Code:
string mybiatch = "blah blah";
bybiatch = mybiatch.toUpper();
-
Mar 16th, 2002, 07:53 PM
#3
Thread Starter
Frenzied Member
I know about the toUpper function. I was'nt refering to that one.
VB has a function call StrConv.
This is what I wanted to do.
In CD database, the CD Titles were entered using upper case.
eg. "COMPACT DISK"
I wanted "Compact Disk"
StrConv converts the first letter of each word to uppercase and the rest of the letters lowercase.
That is what is refered to as propercase.
Dont gain the world and lose your soul
-
Mar 17th, 2002, 11:41 AM
#4
Hyperactive Member
Re: FYI - You can use VB specific functions in any C# project
-
Apr 4th, 2002, 03:06 PM
#5
Frenzied Member
.NET does have a way to convert to Propercase (now called Titlecase) in C#...
I wrote a quick example for ya!
be sure to add
PHP Code:
using System.Globalization;
PHP Code:
CultureInfo ci = new CultureInfo("en"); //Create a new CultureInfo class for the english language
TextInfo cc = ci.TextInfo; //Get the textinfo class from the CultureInfo object
MessageBox.Show(cc.ToTitleCase("helLo joP hOw ArE yOU?"));
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|