how to clear the items in a string array

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gracepaul
    New Member
    • Jul 2008
    • 28

    how to clear the items in a string array

    hi all,

    how to clear the items in an array containing string values..

    when i search, i got the solution as array.clear();

    but i can't got this object..

    is there any namespace that i have to be added in my project...

    thanks in advance

    Grace
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    If you have a System.Web.UI.W ebControls then you should be right. Are you getting an error?

    Comment

    • gracepaul
      New Member
      • Jul 2008
      • 28

      #3
      i didn't get any error..

      Comment

      • cloud255
        Recognized Expert Contributor
        • Jun 2008
        • 427

        #4
        Hi

        Could you post the code which is giving problems so that we may have a look at it?

        Comment

        • Curtis Rutland
          Recognized Expert Specialist
          • Apr 2008
          • 3264

          #5
          That's because you are probably using the syntax wrong.

          Here's how you would use it.
          Code:
          string[] x = new string[5];
          .
          .
          .
          Array.Clear(x, 0, 5);

          Comment

          • gracepaul
            New Member
            • Jul 2008
            • 28

            #6
            Thanks a lot..

            it works well...

            Grace

            Comment

            Working...