RealDocs

UKismetTextLibrary::TextIsEmpty

function Engine Blueprint Since unknown
#include "Kismet/KismetTextLibrary.h"
Access: public Specifiers: staticBlueprintPure

Description

Returns true if the given text is empty.

Caveats & Gotchas

  • Checks for zero-length content, not whether the text is unset — FText::GetEmpty() and a freshly default-constructed FText both return true here.
  • Whitespace-only text (e.g. a single space) is not considered empty; trim it first with TextTrimPrecedingAndTrailing if you need that check.

Signature

static bool TextIsEmpty(const FText& InText)

Parameters

Name Type Description Default
InText const FText& The text to check.

Return Type

bool

Example

Guard against empty player input C++
FText EnteredName = NameInputBox->GetText();
if (UKismetTextLibrary::TextIsEmpty(EnteredName))
{
    ShowValidationError();
    return;
}

Version History

Introduced in: unknown

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.