Geeks With Blogs

News My Blog has been MOVED to https://mfreidge.wordpress.com
Michael Freidgeim's OLD Blog My Blog has been MOVED to https://mfreidge.wordpress.com

// <summary>
       ///if sToFind not found, then original string should be returned
       /// Otherwise removeBefore
       /// </summary>
       /// <param name="str"></param>
       /// <param name="sToFind"></param>
       /// <returns></returns>
       public static string RemoveBefore(this string str, string sToFind)
       {
           int num1 = str.IndexOf(sToFind);
           if (num1 > 0)
           {
               return str.Remove(0, num1);
           }
           else
           {
               return str;
           }
           
       }

Posted on Thursday, May 12, 2011 6:30 AM .Net Framework | Back to top


Comments on this post: string RemoveBefore helper function

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Michael Freidgeim | Powered by: GeeksWithBlogs.net