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.14.0
public string StringVariation(
	string key,
	User user,
	string defaultValue


Type: SystemString
the unique feature key for the feature flag
Type: LaunchDarkly.ClientUser
the end user requesting the flag
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


ILdClientStringVariation(String, User, String)

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