title: string manipulation using Directory.GetFiles()
body: <p>i am assigning <code>images[]</code> with an array that holds images file names with full path of given Directory.</p>
  
   <pre class="lang-C# prettyprint-override"><code>string[] images = DirLoad.FileNamesArray(
                                            IO.Loaders.PathType.full, 
                                            IO.Loaders.FileExtension.jpg
                                          );
  </code></pre>
  
  <p>...now, that <code>images[]</code> stores all the file names i need, as I had to use the <strong>full path</strong> to get it done,</p>
  
  <p>using <code>Directory.GetFiles()</code></p>
  
  <p>Next action requires it as a <strong>local file name</strong>.</p>
  
  <p>(each is then passed as string type parameter to another method)</p>
  
  <p>so my question is : </p>
  
  <p><strong>How can i omit first part - <code>HttpRuntime.AppDomainAppPath</code> ...if it's same in every element of array ?</strong></p>
  
  <p>this is usage example, the string is <code>currentDir</code> i need to trim from each element in <code>images[]</code></p>
  
   <pre class="lang-C# prettyprint-override"><code>    public class IO
      {
          public class Loaders
          {
              readonly string currentDir = HttpRuntime.AppDomainAppPath;
  
              public string selecedDirName { get; set; }
              /// &lt;summary&gt;
              /// assign The Loaders.selectedDir First before calling
              /// &lt;/summary&gt;
              /// &lt;param name="foldertoLoad"&gt;&lt;/param&gt;
              /// &lt;returns&gt;&lt;/returns&gt;
              public enum PathType
              {
                  full, local
              }
              public enum FileExtension
              {
                  jpg,png,txt,xml,htm,js,aspx,css
              }
              public string[] FileNamesArray(PathType SelectedPathMode, FileExtension selectedfileType)
              {
                  string thisFolder = "";
                  string thatFileType= string.Format("*.{0}",selectedfileType.ToString());
                  switch (SelectedPathMode)
                  {
                      case PathType.full:
                          thisFolder = Path.Combine(currentDir, selecedDirName);
                          break;
                      case PathType.local:
                          thisFolder = selecedDirName;
                          break;
                      default:
                          break;
                  }
  
                  string[] foundArr = Directory.GetFiles(thisFolder, thatFileType);
                  return foundArr;
              }
          }
  
      }
  </code></pre>
  
  <p>Update , this is what i've tried</p>
  
   <pre class="lang-C# prettyprint-override"><code>string fileName;
  string[] images = DirLoad.FilesArray(IO.Loaders.PathType.full, IO.Loaders.FileExtention.jpg);
          foreach (var currImage in images)
          {
                int startingAt = DirLoad.currentDir.Length ;
                int finalPoint = currImage.Length - startingAt;
                fileName = new String(currImage.ToCharArray(startingAt, finalPoint));
                baseStyle.Add(string.Format("{0}url({1}) {2}", BackGroundCssProp, fileName, imageProps));
          }
  
          return baseStyle.ToArray();
  </code></pre>