mirror of https://github.com/abpframework/abp.git
committed by
GitHub
2 changed files with 30 additions and 6 deletions
@ -0,0 +1,21 @@ |
|||
using System.Text.RegularExpressions; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.Cli.Utils |
|||
{ |
|||
public static class NamespaceHelper |
|||
{ |
|||
public static string NormalizeNamespace([CanBeNull] string value) |
|||
{ |
|||
if (string.IsNullOrEmpty(value)) |
|||
{ |
|||
return value; |
|||
} |
|||
|
|||
value = value.Trim(); |
|||
value = Regex.Replace(value, @"(((?<=\.)|^)((?=\d)|\.)|[^\w\.])|(\.$)", "_"); |
|||
|
|||
return value; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue