System.Web.HttpRequest.CharsFromList C# (CSharp) Method

CharsFromList() private static method

private static CharsFromList ( string list ) : char[]
list string
return char[]
		private static char[] CharsFromList (string list)
		{
			// List format is very strict and enforced by the Configuration	
			// there must be a single char separated by commas with no trailing comma
			// whitespace is allowed though and should be trimmed.
			
			string [] pieces = list.Split (',');

			char [] chars = new char [pieces.Length];
			for (int i = 0; i < chars.Length; i++) {
				string trimmed = pieces [i].Trim ();
				if (trimmed.Length != 1) {
					// This should have been caught by System.Web.Configuration
					// and throw a configuration error. This is just here for sanity
					throw new System.Configuration.ConfigurationErrorsException ();
				}

				chars [i] = trimmed [0];
			}

			return chars;
		}
#endif