Einzelnen Beitrag anzeigen

Benutzerbild von Forlan
Forlan

Registriert seit: 17. Feb 2008
Ort: Herford
265 Beiträge
 
Delphi 2007 Architect
 
#1

[c++] Funktion "Equals" gibt nur true zurück

  Alt 15. Dez 2009, 11:28
Hallo zusammen,

zunächst einmal der Code...

Code:
   private: System::String^ CreatePalindrom(System::String^ input){
             String^ x = input;
             String^ res = "";

             for(int i = 0; i < x->Length; i++){
                res = x->Substring(i, 1) + res;
             }
             return res;
          }
    private: System::Boolean^ IsPalindrom(System::String^ input){
              String^ x = CreatePalindrom(input);
              return (x->Equals(input)); //<-- gibt immer true zurück
           }
Mein Problem ist, dass die besagte Stelle im code immer true zurück gibt... Aber warum?

Danke im voraus,
Marcel
マルセル
www.youtube.com/beethoven1990
  Mit Zitat antworten Zitat