Autor Beitrag
Raffa1989
Hält's aus hier
Beiträge: 13



BeitragVerfasst: Mi 04.02.09 14:10 
hallo ich habe folgendes Problem
ich will eine string variable in eine int variable umwandeln, hab aber 0 plan wie das geht msdn hat mir auch nix ausgespuckt
vil weis ja jemand wie es geht:)
bitte um Hilfe!
Mfg
Raffa
bakachan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 503
Erhaltene Danke: 34

W7 (x64) Ultimate
C# / VB.NET (VS2010 Ultimate)
BeitragVerfasst: Mi 04.02.09 14:14 
Sowohl die MSDN als auch google helfen da weiter

aber hier die Lösung:
ausblenden C#-Quelltext
1:
integerVariable = int.Parse(stringVariable);					

oder ums schöner und sicherer zu machen(gibt zurück ob die Umwandlung erfolgreich war):
ausblenden C#-Quelltext
1:
bool result = int.TryParse(stringVariable, out integerVariable);					
Raffa1989 Threadstarter
Hält's aus hier
Beiträge: 13



BeitragVerfasst: Mi 04.02.09 14:32 
danke dir hat geklappt ^^ ;)