Refactor CapyKit utilities: streamline namespaces, improve code consistency, and enhance XML documentation.
This commit is contained in:
parent
2b30a8b5e9
commit
f03f73afc7
28 changed files with 5180 additions and 4298 deletions
|
|
@ -1,33 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace CapyKit.Helpers
|
||||
namespace CapyKit.Helpers;
|
||||
|
||||
/// <summary>
|
||||
/// Helper class for handling text transformations.
|
||||
/// </summary>
|
||||
public class LanguageHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper class for handling text transformations.
|
||||
/// </summary>
|
||||
public class LanguageHelper
|
||||
#region Methods
|
||||
|
||||
/// <summary> Converts camel case text to human readable text. </summary>
|
||||
/// <remarks>
|
||||
/// Camel case is a naming convention for identifiers in which the first letter of each word is
|
||||
/// capitalized.
|
||||
/// </remarks>
|
||||
/// <param name="value"> The value. </param>
|
||||
/// <returns> A string in human readable format. </returns>
|
||||
public static string CamelCaseToHumanReadable(string value)
|
||||
{
|
||||
#region Methods
|
||||
var regex = new Regex(@"(?<=[A-Z])(?=[A-Z][a-z]) | (?<=[^A-Z])(?=[A-Z]) | (?<=[A-Za-z])(?=[^A-Za-z])",
|
||||
RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
/// <summary> Converts camel case text to human readable text. </summary>
|
||||
/// <remarks>
|
||||
/// Camel case is a naming convention for identifiers in which the first letter of each word is
|
||||
/// capitalized.
|
||||
/// </remarks>
|
||||
/// <param name="value"> The value. </param>
|
||||
/// <returns> A string in human readable format. </returns>
|
||||
public static string CamelCaseToHumanReadable(string value)
|
||||
{
|
||||
var regex = new Regex(@"(?<=[A-Z])(?=[A-Z][a-z]) | (?<=[^A-Z])(?=[A-Z]) | (?<=[A-Za-z])(?=[^A-Za-z])", RegexOptions.IgnorePatternWhitespace);
|
||||
|
||||
return regex.Replace(value, " ");
|
||||
}
|
||||
|
||||
#endregion
|
||||
return regex.Replace(value, " ");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue