Moved Pithos data and logs from the GRNET folder under AppData to a GRNET\PITHOS...
[pithos-ms-client] / trunk / Pithos.Core / Agents / CollectionExtensions.cs
index 642d5bc..781631c 100644 (file)
@@ -227,5 +227,24 @@ namespace Pithos.Core.Agents
                 //Ensure that the candidate target is indeed below the root\r
                 && InnerAtOrBelow(targetSegments, rootSegments);\r
         }\r
+\r
+        /// <summary>\r
+        /// Returns the part of the target string that comes after the prefix string.\r
+        /// The target is not modified if it doesn't start with the prefix string\r
+        /// </summary>\r
+        /// <param name="target"></param>\r
+        /// <param name="remove"></param>\r
+        /// <returns></returns>\r
+        public static string After(this string target,string prefix)\r
+        {            \r
+            //If the prefix or the target are empty, return the target\r
+            if (String.IsNullOrWhiteSpace(prefix) || String.IsNullOrWhiteSpace(target))\r
+                return target;\r
+            if (target.StartsWith(prefix))\r
+                return target.Remove(0,prefix.Length);\r
+            return target;\r
+        }\r
     }\r
+\r
+\r
 }\r