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. Can apple ArrayList in string[]

Can apple ArrayList in string[]

Scheduled Pinned Locked Moved C#
helptutorialquestion
2 Posts 2 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.
  • A Offline
    A Offline
    arbrsoft
    wrote on last edited by
    #1

    public ArrayList strline=new ArrayList(); strline.Add("I found a reason for me. To change who I used to be. A reason to start over new. And the reason is you."); strline.Add("Anger dwells only in the bosom of fools - John F. Kennedy."); I hoped this could be work. but it didn't. I want to replace string[] with readed Line by Line in txt file. and I know how to read line by line but string[] Length is fixed as initial. so I tried apple ArrayList in string[] but it's not easy to me. How can we treat this? Help me please. Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.

    J 1 Reply Last reply
    0
    • A arbrsoft

      public ArrayList strline=new ArrayList(); strline.Add("I found a reason for me. To change who I used to be. A reason to start over new. And the reason is you."); strline.Add("Anger dwells only in the bosom of fools - John F. Kennedy."); I hoped this could be work. but it didn't. I want to replace string[] with readed Line by Line in txt file. and I know how to read line by line but string[] Length is fixed as initial. so I tried apple ArrayList in string[] but it's not easy to me. How can we treat this? Help me please. Image will remind us some feelings and if I can ask someone about a problem, that's not a bad life.

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Try using System.Collections.Specialized.StringCollection instead. Otherwise you can just returned objects from the ArrayList to string manually, string myStr = (string)myArrayList[0]; Does that answer your question? Judah Himango

      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