arraylist - change names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kieran5405
    New Member
    • Nov 2006
    • 4

    arraylist - change names

    Hi,

    I have an arraylist of .jpgs and i am trying to rename the items in the array. i want to drop the .jpg of each item. NB each item name is unique.

    However i keep getting a message that the array items are readonly.

    In the below code - i can write out the names without the .jpg part. how do i make this permament.

    thanks for all help...


    ------------------------------------------------


    For Each fi As FileInfo In FilesArrayList
    Response.Write( fi.Name.Replace (".jpg", ""))

    Next
  • bnchd
    New Member
    • Nov 2006
    • 3

    #2
    Originally posted by kieran5405
    Hi,

    I have an arraylist of .jpgs and i am trying to rename the items in the array. i want to drop the .jpg of each item. NB each item name is unique.

    However i keep getting a message that the array items are readonly.

    In the below code - i can write out the names without the .jpg part. how do i make this permament.

    thanks for all help...


    ------------------------------------------------


    For Each fi As FileInfo In FilesArrayList
    Response.Write( fi.Name.Replace (".jpg", ""))

    Next


    hi kieran5405


    well u can try it by first converting ur file list in to simple arraylist and then changing its name.

    thanks
    bnchd

    Comment

    • kieran5405
      New Member
      • Nov 2006
      • 4

      #3
      Originally posted by bnchd
      hi kieran5405


      well u can try it by first converting ur file list in to simple arraylist and then changing its name.

      thanks
      bnchd
      hi bnchd,

      thanks for reply. i have been trying to convert it into a simple arraylist using the following but it bring up cast errors. could you give me an example of how you mean to convert it to a simple arraylist.

      thanks..


      Dim ListArray As String() = CType(FilesArra yList.ToArray(G etType(String)) , String())

      Comment

      Working...