Como están,
Tengo este codigo
class App
{
static void Main()
{
string a = "the fellowship of the ring";
string b = "The two towers";
int n = string.Compare(a,b,true);
int m = string.Compare(a,b,false);
Console.WriteLine("n={0}, m={1}",n,m);
}
}
Yo esperaria n = -1 (No tengo en cuenta el case) y m = 1 ('T' <
't' si tengo en cuenta el case). Sinembargo, obtengo n = m = -1)
Si pongo a = "a" y b="A" funciona perfectamente n=0 y m=-1
Si pongo a= "aa" y b="Ab" no tiene en cuenta que las mayúsculas van primero
que las minusculas.
Estoy haciendo algo mal o es un comportamiento esperado (y por cierto
extraño en String::Compare)??
Saludos
____________________
Ramiro Calderon Romero
rcrdev@hotmail.com
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
Leer las respuestas