RealDocs

UKismetStringLibrary::LeftChop

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

Description

Returns the leftmost characters of a string after removing the given number of characters from the end.

Caveats & Gotchas

  • Easy to confuse with Left: Count here is how many characters to drop from the end, not how many to keep — Left(S, N) and LeftChop(S, S.Len() - N) return the same thing.
  • If Count is greater than or equal to the string's length, an empty string is returned.

Signature

static FString LeftChop(const FString& SourceString, int32 Count)

Parameters

Name Type Description Default
SourceString const FString& The string to chop.
Count int32 The number of characters to remove from the end.

Return Type

FString

Example

Strip a known file extension C++
FString NameOnly = UKismetStringLibrary::LeftChop(TEXT("Texture.png"), 4);
// NameOnly == "Texture"

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.