RealDocs

UKismetStringLibrary::StartsWith

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

Description

Tests whether a string begins with the given prefix. Commonly used to check console command names, asset path prefixes, or tag conventions.

Caveats & Gotchas

  • The SearchCase parameter is not exposed as a Blueprint pin at all — Blueprint callers always get case-insensitive matching.
  • An empty InPrefix always returns true, since every string starts with an empty prefix.

Signature

static bool StartsWith(const FString& SourceString, const FString& InPrefix, ESearchCase::Type SearchCase = ESearchCase::IgnoreCase)

Parameters

Name Type Description Default
SourceString const FString& The string to test.
InPrefix const FString& The prefix to look for.
SearchCase ESearchCase::Type Whether the comparison is case-sensitive. ESearchCase::IgnoreCase

Return Type

bool

Example

Check an asset path prefix C++
if (UKismetStringLibrary::StartsWith(AssetPath, TEXT("/Game/"), ESearchCase::CaseSensitive))
{
    // AssetPath lives under /Game/
}

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.