Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. array to array copy

array to array copy

Scheduled Pinned Locked Moved C#
data-structuresquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    varsh12
    wrote on last edited by
    #1

    i want to copying array values to another array. my vaue is store the following array:

    string[] path = Directory.GetFiles(filedate);

    and I want to copy, stored value in path into path1.

    string[] path1= ???

    thanx

    N P 2 Replies Last reply
    0
    • V varsh12

      i want to copying array values to another array. my vaue is store the following array:

      string[] path = Directory.GetFiles(filedate);

      and I want to copy, stored value in path into path1.

      string[] path1= ???

      thanx

      N Offline
      N Offline
      Nuri Ismail
      wrote on last edited by
      #2

      You can do this by using Array.Copy[^] method. :) Example:

      string [] path = Directory.GetFiles(filedate);
      if(path.Length > 0)
      {
      string [] path1 = new string[path.Length];
      Array.Copy(path, path1, path.Length);
      }

      :)

      1 Reply Last reply
      0
      • V varsh12

        i want to copying array values to another array. my vaue is store the following array:

        string[] path = Directory.GetFiles(filedate);

        and I want to copy, stored value in path into path1.

        string[] path1= ???

        thanx

        P Offline
        P Offline
        PIEBALDconsult
        wrote on last edited by
        #3

        Why?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups