Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2004

Tip: Looking for answers? Try searching our database.

Comparing two strings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vycka - 13 Sep 2004 17:17 GMT
A simple question:
How to compare two strings finding out which one should go first
alphabetically?
In other words is there a function that would told us which string of two
strings should stand first in alphabet?

I hope you understand my problem.

I'm working with VS.NET C#

Thank you
lukasz - 13 Sep 2004 17:20 GMT
string1.CompareTo(string2);

> A simple question:
> How to compare two strings finding out which one should go first
[quoted text clipped - 7 lines]
>
> Thank you
mdb - 13 Sep 2004 18:39 GMT
Or more "logically" (does the same thing really):

 string1 > string2
or
 string1 < string2

-mdb

> string1.CompareTo(string2);
>
[quoted text clipped - 3 lines]
>> In other words is there a function that would told us which string of
>> two strings should stand first in alphabet?
lukasz - 13 Sep 2004 19:18 GMT
> Or more "logically" (does the same thing really):
>
>   string1 > string2
> or
>   string1 < string2

I had a compile error when I tried to use operator?
Herfried K. Wagner [MVP] - 13 Sep 2004 19:38 GMT
* mdb <m_b_r_a_y@c_t_i_u_s_a__d0t__com> scripsit:
> Or more "logically" (does the same thing really):
>
>   string1 > string2
> or
>   string1 < string2

VB.NET doesn't support operator overloading, thus this code doesn't
work.

Signature

M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/

mdb - 13 Sep 2004 21:56 GMT
hirf-spam-me-here@gmx.at (Herfried K. Wagner [MVP]) wrote in news:#
1pFjDcmEHA.536@TK2MSFTNGP11.phx.gbl:
> VB.NET doesn't support operator overloading, thus this code doesn't
> work.

Hrmph.  <disparaging comments withheld.>

Anyway, the guy said he was using C#.  Even so I feel like a moron since
that isn't default in C# either.  I must have reverted to an infantile
stage of my life when < and > would compare strings like you would think.

-mdb

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.