C# Cookbook by Stephen Teilhet, Jay Hilyard The unconfirmed error reports are from readers. They have not yet been approved or disproved by the author or editor and represent solely the opinion of the reader. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification This page was updated April 9, 2008. UNCONFIRMED errors and comments from readers: [209] Before the last line of this page; In the method: internal void Add(SomeDataOriginator.Memento memento) { SaveState.Add(memento); } should read: saveState.Add(memento); Note: the variable saveState was previously declared at the line 2 of the class MultiMementoCareTaker. Page 530 RemoveAt method description Add ( int index ) should read RemoveAt ( int index ) {582} FindAllIllegalChars example; The invalidCharPos increments in the last else statment of the example is redudant and could eventually make the routine miss one illegal character in the userEnteredPath parameter. The invalidCharPos variable is already incremented by one when passed to the String.IndexOfAny method at the beginning of the example. When the subsequent increment is made, one character is missed in the next call to String.IndexOfAny. I've used example in a routine that replace all illegal characters in a file name with undescores: private string ReplaceAnyIllegalChars(string OutputFileName) { int invalidCharPos = -1; bool endOfName = false; bool foundIllegalChars = false; string fileName = OutputFileName; while (!endOfName) { invalidCharPos = fileName.IndexOfAny(Path.GetInvalidFileNameChars(), invalidCharPos + 1); if (-1 == invalidCharPos) { endOfName = true; } else { foundIllegalChars = true; fileName = fileName.Replace(OutputFileName[invalidCharPos], '_'); if (invalidCharPos >= fileName.Length - 1) { endOfName = true; } } } return fileName; }