UKismetStringLibrary::LeftPad
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Pads the left side of a string with spaces until it reaches the given total length. Used for aligning columns of text output.
Caveats & Gotchas
- • ChCount is the target total width, not the number of characters to add — if SourceString is already that long or longer, it is returned unchanged.
- • Padding always uses spaces; there is no way to specify a different pad character from Blueprint or C++.
Signature
static FString LeftPad(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
Align a numeric column C++
FString Padded = UKismetStringLibrary::LeftPad(TEXT("42"), 6);
// Padded == " 42" Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?