|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
String ComparisionHello There,
How do i compare string such that A < B<... <Y<Z<BA<BB... <CA... <ZZ Thanks KB Write a comparer for it as Z < BA == false in normal coding. You would need
to compare lengths first, then compare two of the same length as normal I imagine. HTH Ciaran O'Donnell Show quoteHide quote "Kb" wrote: > Hello There, > > How do i compare string such that A < B<... <Y<Z<BA<BB... <CA... <ZZ > > Thanks > KB > "Kb" <forlist2***@yahoo.com> wrote in message It might be best to think of these as numbers but in base 36. Then the above news:ueHo7El3GHA.1588@TK2MSFTNGP02.phx.gbl... > Hello There, > > How do i compare string such that A < B<... <Y<Z<BA<BB... <CA... <ZZ comparisons would be correct. PS In addition to the other comments, you might be able to PadLeft the shorter
string with max length of the two strings... Something like: Public Class SpecialComparer Implements IComparer(Of String) Public Function Compare(ByVal x As String, ByVal y As String) As Integer Implements IComparer(Of String).Compare Dim totalWidth As Integer = Math.Max(x.Length, y.Length) Return String.Compare(x.PadLeft(totalWidth), y.PadLeft(totalWidth)) End Function End Class -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "Kb" <forlist2***@yahoo.com> wrote in message news:ueHo7El3GHA.1588@TK2MSFTNGP02.phx.gbl... > Hello There, > > How do i compare string such that A < B<... <Y<Z<BA<BB... <CA... <ZZ > > Thanks > KB
vbCrLf
Querying a database using vb Get value from nested class using reflection Want to know the power-2 based numbers of x OpenGL Refresh problem using CsGL with VB.NET Resolving Type mismatch, HOW How to disable the UAC in Vista? How to keep statusStrip at the bottom of the ToolStripContainer Sub(Thing as Object) {thing = new Thing.GetType} ? Requesting implementation details of Regsitry Optimization and Defragmentation |
|||||||||||||||||||||||