以获取fstring为例 FString UTestObject::GetStrPropertyValueByName(const FName InName, const UObject* PropertyOwner) { FString Value; if(!IsValid(PropertyOwner) ||!IsValid(PropertyOwner->GetClass())) { return Value; } FProperty* TragetProperty= PropertyOwner->GetClass()->FindPropertyByName(InName); if(!TragetProperty) { return Value; } if(TragetProperty->IsA(FStrProperty::StaticClass())) { const FStrProperty* StrProperty=CastField<FStrProperty>(TragetProperty); if(StrProperty) { Value= StrProperty->GetPropertyValue_InContainer(PropertyOwner); } } return Value; }