Commit dd9e9c8d authored by Marc Gravell's avatar Marc Gravell

Add `ToString[]` extension method

parent b8e45aef
......@@ -111,5 +111,16 @@ public static class ExtensionMethods
}
return result;
}
static readonly string[] nix = new string[0];
/// <summary>
/// Create an array of strings from an array of values
/// </summary>
public static string[] ToStringArray(this RedisValue[] values)
{
if (values == null) return null;
if (values.Length == 0) return nix;
return Array.ConvertAll(values, x => (string)x);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment