logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: Best way to convert "cAsE" to "Case"?: msg#00150

windows.devel.dotnet.cx

Subject: Re: Best way to convert "cAsE" to "Case"?

actually i did do the Upper solution. The reason i WAS using a mixed
case was solely for my readability and code cleanliness. I prefer the
look vs ALL CAPS / lower, But none the less, i gave in until i find
another solution. But im not ganna waste all my time on this little
thing :o

So for now all the enums are CAPS, and i use ToUpper()

On 9/20/05, Kenneth Lee <KPLCJL@xxxxxxx> wrote:
> In a message dated 9/19/2005 6:07:53 PM Pacific Standard Time,
> zeusbwr@xxxxxxxxx writes:
>
> perfect! though i still need to get by IsDefined..
>
>
>
>
> So, why are you writing YOUR enum in mixed case? (If someone else is
> writing it, getting around case could get tricky ->"ThisValueIsMine".
> "THISVALUEISMINE" is easy to match.)
>
> You could have a set of if statements:
> if (InpStr.ToLower() == "thisvalueismine") InpStr = "ThisValueIsMine" ;
> and use whatever case enum values you want. You could wrap the set with an
> if !IsDefined so the logic is only executed when case doesn't already match.
> (NOT my favorite solution, change the set of enums, change this logic.)
>
> You could loop through the enum values and convert both the values and the
> input string to lower case and compare them. (A better solution.)
>
> You can use the try/catch method. If you've already converted the value to
> a string, verified it isn't null, then set up the try/catch to only convert
> the string to an enum, you've pretty much eliminated the possible alternate
> errors. (If the other program blows up, it will never reach the try, the
> catch
> won't be executed.) Let the purists on this board howl, it's a solution.
>
> I'd still like an answer to my first question. That removes the problem
> completely and it should keep any purist reading your code happy.
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>


--
Zeusbwr[at]gmail.com,
http://www.google.com/talk/

Project Blog: http://zeusbwr.blogspot.com/

===================================
This list is hosted by DevelopMentor® http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qnx.openqnx.dev...    gcc.libstdc++.c...    solaris.opensol...    information-ret...    misc.misterhous...    web.catalyst.ge...    apache.webservi...    redhat.release....    hardware.lirc/2...    kernel.autofs/2...    technology.sust...    linux.vdr/2003-...    editors.lyx.gen...    org.user-groups...    netbsd.devel.pk...    xdg.devel/2004-...    version-control...    jakarta.slide.d...    debian.packages...    creativecommons...    ports.ppc.embed...    bug-tracking.bu...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation