UKismetStringLibrary::Trim
#include "Kismet/KismetStringLibrary.h"
Access: public
Specifiers: staticBlueprintPure
Description
Removes whitespace characters from the front of a string. Commonly used to clean up user-entered text before validating or displaying it.
Caveats & Gotchas
- • Only trims leading whitespace — trailing whitespace is left untouched; use TrimTrailing for that side.
- • "Whitespace" follows FChar::IsWhitespace, which includes tabs and newlines, not just spaces.
Signature
static FString Trim(const FString& SourceString) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| SourceString | const FString& | The string to trim. | — |
Return Type
FString Example
Clean up a text field C++
FString Cleaned = UKismetStringLibrary::TrimTrailing(UKismetStringLibrary::Trim(RawInput)); See Also
Tags
Version History
Introduced in: unknown
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?