Autor Beitrag
ani
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77

Windows Vista Home Premium
C#(VS 2008)
BeitragVerfasst: Do 27.10.05 09:30 
Ich würde gerne einen Buchstaben duch einen andern ersetzen, bzw. einen Buchstaben durch 2 --> ß=ss, ü=ue usw.
Ich bastel mir hier grad was zusammen ist mir aber zu umständlich und wie ich C# kenne gibts da schon eine Methode die das für mich erledigt :)

Ich bitte um Hilfe :)
MathiasSimmack
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 27.10.05 10:02 
Wie wäre es mit dem eingebauten Replace bei Strings?
Genügt dir das schon?
ani Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77

Windows Vista Home Premium
C#(VS 2008)
BeitragVerfasst: Do 27.10.05 10:08 
Das hab ich auch gefunden, nur...

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
string[] zeilen = new string[4];
zeilen[0] = "süße";
zeilen[1] = "Mögen";
zeilen[2] = "mähen";
zeilen[3] = "kühe";

                zeilen[0].Replace('ß','s');

string hallo = "hallo das ist ein String";

                hallo.Replace("a","b");  // oder ('a','b')

textBox1.Text = hallo;


macht der nicht ! :(
wie ist das mit der Methode erweitert die mein Array dann automatisch oder geht dat garnich?
Robert_G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 416


Delphi32 (D2005 PE); Chrome/C# (VS2003 E/A, VS2005)
BeitragVerfasst: Do 27.10.05 10:15 
String.Replace liefert einen String. Und rate mal warum? :mrgreen:
Probier es mal so: string hbllo = "hallo".Replace('a''b');

btw: Du nimmst ja schon wieder arrays... ;)
ani Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77

Windows Vista Home Premium
C#(VS 2008)
BeitragVerfasst: Do 27.10.05 10:17 
:P

klar das hab ich auch eben festgestellt ;)

zu "meinen Arrays":
ja ich mach alles leider immer noch auf c++ basis und erfinde das Rad immer wieder neu