RealDocs

UKismetStringLibrary::RightPad

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

Description

Pads the right side of a string with spaces until it reaches the given total length. Useful for left-aligning text in fixed-width layouts.

Caveats & Gotchas

  • ChCount is the target total width, not the number of characters to add — strings already at or past that length are returned unchanged.
  • Trailing spaces added by this function are easy to lose accidentally if the string is later trimmed with Trim/TrimTrailing.

Signature

static FString RightPad(const FString& SourceString, int32 ChCount)

Parameters

Name Type Description Default
SourceString const FString& The string to pad.
ChCount int32 The total width the resulting string should be padded to.

Return Type

FString

Example

Left-align a label C++
FString Padded = UKismetStringLibrary::RightPad(TEXT("HP"), 8);
// Padded == "HP      "

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.