diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-16 13:38:56 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2017-11-16 13:38:56 +0200 |
| commit | 914f4db513477d9aff726546bac47545195a3e37 (patch) | |
| tree | d2ff190fd84b1dfaa03eec76563c431592ece7ff /Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs | |
| parent | 65d01ff549d80fbe13ff5e966df216c9f7c03653 (diff) | |
| download | Tango-914f4db513477d9aff726546bac47545195a3e37.tar.gz Tango-914f4db513477d9aff726546bac47545195a3e37.zip | |
Rename "Visual Studio" to "Visual_Studio"
Rename "External Repositories" to "External_Repositories".
Diffstat (limited to 'Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs')
| -rw-r--r-- | Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs b/Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs deleted file mode 100644 index 5699d27a0..000000000 --- a/Software/Visual Studio/Tango.Core/ExtensionMethods/StringExtensions.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; - -public static class StringExtensions -{ - private static Regex titleRegEx; - - /// <summary> - /// Initializes the <see cref="StringExtensions"/> class. - /// </summary> - static StringExtensions() - { - titleRegEx = new Regex(@" - (?<=[A-Z])(?=[A-Z][a-z]) | - (?<=[^A-Z])(?=[A-Z]) | - (?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace); - } - - /// <summary> - /// Normal ToString conversion with null checking. - /// </summary> - /// <param name="obj">The object.</param> - /// <returns></returns> - public static String ToStringSafe(this object obj) - { - return obj != null ? obj.ToString() : String.Empty; - } - - /// <summary> - /// Splits the string to lines. - /// </summary> - /// <param name="str">The string.</param> - /// <returns></returns> - public static List<String> ToLines(this String str) - { - return str.Split(new[] { '\r', '\n' }).ToList(); - } - - /// <summary> - /// Formats the string to title style. - /// </summary> - /// <param name="str">The string.</param> - /// <returns></returns> - public static String ToTitle(this String str) - { - return titleRegEx.Replace(str, " "); - } -} |
