473,378 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

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
Nov 16 '06 #1
2 957
bnchd
3
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
Nov 17 '06 #2
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(FilesArrayList.ToArray(GetType(String)), String())
Nov 17 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Peter Afonin | last post by:
Hello, I have a code that queries Active Directory and put logins and names into the ArrayList. Then I need to bind this ArrayList to the DropdDownList, making names as DataTextField and logins...
1
by: RBCC | last post by:
I have the following structure: Structure member Dim name As String Dim phone As String End Structure Dim memberarray As New ArrayList Dim membership As member ******************** Ihave...
0
by: Simon Gregory | last post by:
I'm trying to override the default elementnames in the (seemingly) simple case of serializing an array of GUIDs into XML. Here's the basic code I started with: Dim arrGuids(3) as Guid ...
2
by: sal | last post by:
Greetings All I'm learning to use arraylist and structures but I'm getting a System.NullReferenceException Error and I'm not sure why. I followed the VB.net book all I did was change the names....
16
by: Allen | last post by:
I have a class that returns an arraylist. How do I fill a list box from what is returned? It returns customers which is a arraylist but I cant seem to get the stuff to fill a list box. I just...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
11
by: Simon Says | last post by:
Hi all, I've an arraylist A1 that contains {0,1,2,3,4,5,9,8,7} I've another arraylist A2 that contains {4,5,9} I would like to search whether if A2 is present in A1 and maybe return the first...
6
by: schnag | last post by:
import java.util.*; class Student { private String name; private int score; public Student() { name = ""; score = 0; }
3
by: Christopher H | last post by:
I've been reading about how C# passes ArrayLists as reference and Structs as value, but I still can't get my program to work like I want it to. Simple example: ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.