Added the Length function to the List group in Utility block.

This commit is contained in:
ruri
2019-04-12 09:07:32 +02:00
parent 310eb7bc55
commit 86053cb949
+7
View File
@@ -46,6 +46,9 @@ namespace RuriLib
/// <summary>Creates an empty list variable.</summary>
Create,
/// <summary>Calculates the length of a list.</summary>
Length,
/// <summary>Joins a list into a single string, separating the elements with a separator.</summary>
Join,
@@ -409,6 +412,10 @@ namespace RuriLib
data.Variables.Set(new CVar(variableName, new List<string>(), isCapture));
break;
case ListAction.Length:
data.Variables.Set(new CVar(variableName, list.Count().ToString(), isCapture));
break;
case ListAction.Join:
data.Variables.Set(new CVar(variableName, string.Join(separator, list), isCapture));
break;