Reseting A List<>

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Samishii23
    New Member
    • Sep 2009
    • 246

    Reseting A List<>

    How would I go about doing this?
    Would I have to go through each item removing it?
    Is there a .Reset() sort of sub-function?
    Or can I just do something this easy...
    Code:
    List<string> sMyList = new List<string>();
    ... and would that be be fine?
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    The MSDN would have told you this. It is always the first, best place to look when learning new controls. I recommend a Google technique of searching for "MSDN {control}" such as "MSDN List<>". The first result is nearly always the exact page you need.
    Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists.


    In this case you would have seen there is a .Clear() method.

    Comment

    • Samishii23
      New Member
      • Sep 2009
      • 246

      #3
      Unfortunally to my own image, I did look and didn't see the Clear() at the time... But thanks though!

      Comment

      Working...