RealDocs

UGameplayStatics::GetKeyValue

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

Description

Splits a single key=value pair string into its key and value components. Typically used after iterating over individual pairs extracted from a larger options string.

Caveats & Gotchas

  • If the Pair string contains multiple '=' characters only the first is used as the delimiter; everything after the first '=' becomes the Value, preserving embedded equals signs.
  • This function operates on a single pair, not a full URL options string — pass individual tokens extracted by ParseOption or GrabOption, not the raw multi-key options string.

Signature

static ENGINE_API void GetKeyValue( const FString& Pair, FString& Key, FString& Value );

Parameters

Name Type Description Default
Pair const FString& A single key=value pair string to split.
Key FString& Output: the portion before '='. If no '=' is present this equals the full Pair string.
Value FString& Output: the portion after '='. Empty string if no '=' is present.

Return Type

void

Example

Split an individual pair from a travel URL C++
FString Pair = TEXT("MaxPlayers=16");
FString Key, Value;
UGameplayStatics::GetKeyValue(Pair, Key, Value);
// Key == "MaxPlayers", Value == "16"

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.