diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-07 16:06:38 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-01-07 16:06:38 +0200 |
| commit | e111c33bc87acf40202f9e5423e21b087a366f07 (patch) | |
| tree | fac6d85ec3589620b1daea9a9f740a2120b0ca10 /Software/Visual_Studio/Tango.Core/ExtensionMethods | |
| parent | 6da42fd28ffbb680d85bb9e695520713ff51022a (diff) | |
| download | Tango-e111c33bc87acf40202f9e5423e21b087a366f07.tar.gz Tango-e111c33bc87acf40202f9e5423e21b087a366f07.zip | |
Added new events !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.Core/ExtensionMethods')
| -rw-r--r-- | Software/Visual_Studio/Tango.Core/ExtensionMethods/StringExtensions.cs | 12 |
1 files changed, 12 insertions, 0 deletions
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<T> ToEnumValues<T>(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<T>(); + } + } } |
