From e111c33bc87acf40202f9e5423e21b087a366f07 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 7 Jan 2019 16:06:38 +0200 Subject: Added new events !!! --- .../Tango.Core/ExtensionMethods/StringExtensions.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods') diff --git a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs index f03bcb647..7a03b8ae4 100644 --- a/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs +++ b/Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs @@ -233,4 +233,16 @@ public static class StringExtensions { return String.IsNullOrEmpty(str) ? null : str; } + + public static List ToEnumValues(this String str, char splitChar) where T : struct + { + if (!String.IsNullOrWhiteSpace(str)) + { + return str.Split(splitChar).Select(x => (T)Convert.ChangeType(int.Parse(x),typeof(T))).ToList(); + } + else + { + return new List(); + } + } } -- cgit v1.3.1