I remind old days posting here. But blarg, this issue is annoying. Even Google failed. I'll make it simple and easy. this.TypeNames[0] is "Normal", it's obviously, inside of an array. TypeName is also "Normal". Whatever, seems like Normal != Normal. Code (text): sys.sendAll("Are they equal? " + (this.TypeNames[0] == TypeName)); sys.sendAll("TypeNames[0]: " + (this.TypeNames[0])); sys.sendAll("TypeNames[0] typeof: " + (typeof(this.TypeNames[0]))); sys.sendAll("TypeName: " + (TypeName)); sys.sendAll("TypeName typeof: " + (typeof(TypeName))); sys.sendAll(this.TypeNames[0].replace(TypeName, "")); Results: