Description:
Exception = System.ArgumentOutOfRangeException
Message = Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: length
FullText = System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: length
at System.String.ToCharArray(Int32 startIndex, Int32 length)
at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.SendMessageDirectWithLength(UInt32 msg, Int32 wParam, String lParam)
at ScintillaNet.Scintilla.ScintillaNet.INativeScintilla.ReplaceTarget(Int32 length, String text)
at ScintillaNet.Range.set_Text(String value)
at ScintillaNet.FindReplace.ReplaceAll(Int32 startPos, Int32 endPos, String searchString, String replaceString, SearchFlags flags)
at ScintillaNet.FindReplace.ReplaceAll(String searchString, String replaceString, SearchFlags flags)
at ScintillaNet.FindReplaceDialog.btnReplaceAll_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
How to repeat:
Search and replace of '[' with ' '(space) in an MSSQL script I was attempting to translate.
Suggested fix:
improve the bounds checking