Revision 62d5b25f trunk/Pithos.Core/Agents/CollectionExtensions.cs

b/trunk/Pithos.Core/Agents/CollectionExtensions.cs
227 227
                //Ensure that the candidate target is indeed below the root
228 228
                && InnerAtOrBelow(targetSegments, rootSegments);
229 229
        }
230

  
231
        /// <summary>
232
        /// Returns the part of the target string that comes after the prefix string.
233
        /// The target is not modified if it doesn't start with the prefix string
234
        /// </summary>
235
        /// <param name="target"></param>
236
        /// <param name="remove"></param>
237
        /// <returns></returns>
238
        public static string After(this string target,string prefix)
239
        {            
240
            //If the prefix or the target are empty, return the target
241
            if (String.IsNullOrWhiteSpace(prefix) || String.IsNullOrWhiteSpace(target))
242
                return target;
243
            if (target.StartsWith(prefix))
244
                return target.Remove(0,prefix.Length);
245
            return target;
246
        }
230 247
    }
248

  
249

  
231 250
}

Also available in: Unified diff