SenseNet.ContentRepository.ContentNamingHelper.RemoveInvalidCharacters C# (CSharp) Метод

RemoveInvalidCharacters() публичный статический Метод

Removes invalid characters from the provided displayname.
public static RemoveInvalidCharacters ( string s ) : string
s string
Результат string
        public static string RemoveInvalidCharacters(string s)
        {
            // NOTE: changing this code requires a change in RemoveInvalidCharacters, GetNoAccents javascript functions in SN.ContentName.js, in order that these work in accordance
            var noaccents = GetNoAccents(s);
            noaccents = new Regex(RepositoryPath.InvalidNameCharsPattern).Replace(noaccents, ContentNamingHelper.PlaceholderSymbol.ToString());
            // space is also removed
            noaccents = noaccents.Replace(' ', ContentNamingHelper.PlaceholderSymbol);
            // '-' should not be followed by another '-'
            noaccents = new Regex(ContentNamingHelper.PlaceholderSymbol + "{2,}").Replace(noaccents, ContentNamingHelper.PlaceholderSymbol.ToString());
            noaccents = noaccents.Trim(ContentNamingHelper.PlaceholderSymbol);
            return noaccents;
        }
        /// <summary>