Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[C#] Array lexikographisch sortieren??

Empfohlene Antworten

Veröffentlicht

Wie kann man denn ein Array, d.h. die Werte (bzw. wenn Objekte drinnen liegen, Werte eines Objektparameters), lexikographisch sortieren mit C#?

Wird dazu etwas angeboten, oder muß man dies selbst implementieren?

ein array ist an sich recht doof.

hast du die msdn?

System.Collections.IComparer

und

System.Collections.Comparer

und

Syste.Array.Sort sollte dir weiterhelfen.

bigredeyes

ein array ist an sich recht doof.

hast du die msdn?

System.Collections.IComparer

und

System.Collections.Comparer

und

Syste.Array.Sort sollte dir weiterhelfen.

bigredeyes

Danke hab ich schon gefunden.

Ich hab jetzt ein Array von Objekten.

Kann ich da auch die System.Array.Sort Funktion für den Parameter i des Objekts anwenden, d.h. ich will die ganzen Objekte im Array numb umsortieren nach dem Parameter i??

namespace Sort

{

class Test

{

public String st;

public int i;

public Test(int nu) {

st = "irgendwas";

i = nu;

}

public override string ToString()

{

return i.ToString();

}

}

class Program

{

static void Main(string[] args)

{

Random r = new Random();

Test [] numb = new Test[10];

Test t;

for(int j = 0;j<numb.Length;j++)

{

t = new Test (r.Next(0, 102));

numb[j] = t;

}

for (int i = 0; i < numb.Length; i++)

{

Console.WriteLine("text: " + numb.st);

Console.WriteLine("number: " + numb.i);

}

}

}

}

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.