The RightOf extension heavily relies on the string.IndexOf method of the .NET Framework. Usually when calls string.Substring values for the startIndex and length paramaters to be passed are first determined by calls to string.IndexOf. This extension does those things in one call.

Old code:
string output = sourcetext.Substring(sourcetext.IndexOf("test") + 4);

New code:
string output = sourcetext.RightOf("test");

Last edited Mar 12, 2009 at 11:26 AM by Jacco, version 1


No comments yet.