Click or drag to resize

LdClientStringVariation Method

Calculates the string value of a feature flag for a given user.

Namespace:  LaunchDarkly.Client
Assembly:  LaunchDarkly.ServerSdk (in LaunchDarkly.ServerSdk.dll) Version: 5.13.0
Syntax
public string StringVariation(
	string key,
	User user,
	string defaultValue
)

Parameters

key
Type: SystemString
the unique feature key for the feature flag
user
Type: LaunchDarkly.ClientUser
the end user requesting the flag
defaultValue
Type: SystemString
the default value of the flag

Return Value

Type: String
the variation for the given user, or defaultValue if the flag cannot be evaluated

Implements

ILdClientStringVariation(String, User, String)
Remarks

If the flag variation does not have a string value, defaultValue is returned.

Normally, the string value of a flag should not be null, since the LaunchDarkly UI does not allow you to assign a null value to a flag variation. However, since it may be possible to create a feature flag with a null variation by other means, and also since defaultValue is nullable, you should assume that the return value might be null.

See Also