Simple question, yet I don’t know, I didn’t find any “GetLength” or “GetSize” or whatever in FText, FName nor FString.
FName::ToString(TCHAR * Out, uint32 OutSize) could be a way, with this OutSize parameter, but casting FText to Fname, declaring a uint32 and calling this ToString looks like too much work for such an easy task right ?
void ULobbyMenu::CheckSessionName(const FText& NewName, ETextCommit::Type CommitType)
{
if (NewName.IsEmptyOrWhitespace() || NewName.*SIZE* < 3 || NewName.*SIZE* > 15)
NameFeedback->SetText(FText::FromString("Session name should be between 3 and 15 characters"));
...
}
To be honest I’m unable to answer. You learn with time and research.
For example in this case, despite never having used this function, I knew the engine should have some function that returns the lenght of a string. So I just did a simple browser search: “ue4 c++ lenght”, “ue4 c++ size”, “ue4 c++ len” … and got several results for this last one.
In fact, the one in KismetStringLibrary is actually a pure blueprint function, that uses the one in https://docs.unrealengine.com/en-US/API/Runtime/Core/Containers/FString/Len/index.html from UnrealString.h.