Candor.WindowsAzure.Storage.Queue.CloudQueueRules.GetValidQueueName C# (CSharp) 메소드

GetValidQueueName() 공개 정적인 메소드

Gets a valid azure identifier for queue names by trimming out invalid characters, and changing to lower case. If the name is still invalid, then an exception occurs. See remarks for naming rules.
A queue name must start with a letter or number, and can only contain letters, numbers, and the dash (-) character. The first and last letters in the queue name must be alphanumeric. The dash (-) character cannot be the first or last character. Consecutive dash characters are not permitted in the queue name. All letters in a queue name must be lowercase. A queue name must be from 3 to 63 characters long.
public static GetValidQueueName ( this name ) : String
name this
리턴 String
        public static String GetValidQueueName(this String name)
        {
            var cleanupAttempt = CompiledExpressions.NonAlphaNumericReplaceRegex.Replace(name, "")
                .ToLower()
                .Replace("--", "-");
            if (!CompiledExpressions.AzureQueueValidationRegex.IsMatch(cleanupAttempt))
                throw new ArgumentException("Cannot Determine a valid queue name for the supplied string.");

            return cleanupAttempt;
        }
CloudQueueRules