Hello,
Could someone tell me how to create an array of strings?
Thanks,
Miguel 4 1634
To create an array of a particular size, try the following
string[] myArray = new string[5];
this wuold create an array of 5 strings in C#. There are also array and
collection classes in the System.Collections namespace that can be of help,
such as the NameValueCollection when you need an array of name/value pairs.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"shapper" <md*****@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
Hello,
Could someone tell me how to create an array of strings?
Thanks,
Miguel
Wrong signature (not to be misleading), should be former MVP
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006
"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:u7**************@TK2MSFTNGP02.phx.gbl...
To create an array of a particular size, try the following
string[] myArray = new string[5];
this wuold create an array of 5 strings in C#. There are also array and
collection classes in the System.Collections namespace that can be of
help, such as the NameValueCollection when you need an array of name/value
pairs.
Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
"shapper" <md*****@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
>Hello,
Could someone tell me how to create an array of strings?
Thanks, Miguel
If you don't know the size of the array needed up front, use a collection.
In 2.0, you can use a generic:
List<string myArray = new List<string>();
and then you can do
myArray.Add("1");
in 1.x, use an ArrayList:
ArrayList arr = new ArrayList();
arr.Add("1");
Karl
-- http://www.openmymind.net/ http://www.codebetter.com/
"shapper" <md*****@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
Hello,
Could someone tell me how to create an array of strings?
Thanks,
Miguel
Thank you!
Karl Seguin [MVP] wrote:
If you don't know the size of the array needed up front, use a collection.
In 2.0, you can use a generic:
List<string myArray = new List<string>();
and then you can do
myArray.Add("1");
in 1.x, use an ArrayList:
ArrayList arr = new ArrayList();
arr.Add("1");
Karl
-- http://www.openmymind.net/ http://www.codebetter.com/
"shapper" <md*****@gmail.comwrote in message
news:11*********************@k70g2000cwa.googlegro ups.com...
Hello,
Could someone tell me how to create an array of strings?
Thanks,
Miguel
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brian |
last post by:
I'm diddlying with a script, and found some behavior I don't understand.
Take this snippet:
for ($i = 0; $i <= count($m); $i++) {
array_shift($m);
reset($m);
}
|
by: Stormkid |
last post by:
Hi Group I'm trying to figure out a way that I can take two (two
dimensional) arrays and avShed and shed, and subtract the matching elements
in shed from avShed I've pasted the arrays blow from a...
|
by: lawrence |
last post by:
I wanted to test xml_parse_into_struct() so I took the example off of
www.php.net and put this code up on a site:
<?php
$simple = <<<END
<item>
|
by: vcardillo |
last post by:
Hello all,
Okay, I am having some troubles. What I am doing here is dealing with
an employee hierarchy that is stored in an array. It looks like this:
$employees = array( "user_id" => array(...
|
by: Sam Collett |
last post by:
How do I remove an item with a specified value from an array?
i.e. array values 1,2,2,5,7,12,15,21
remove 2 from array would return
1,5,7,12,15,21
(12 and 21 are NOT removed, duplicates are...
|
by: Mike S. Nowostawsky |
last post by:
I tried using the "toUpperCase()" property to change the value of an array
entity to uppercase BUT it tells me that the property is invalid. It seems
that an array is not considered an object when...
|
by: jr |
last post by:
Sorry for this very dumb question, but I've clearly got a long way to go!
Can someone please help me pass an array into a function. Here's a starting
point.
void TheMainFunc()
{
// Body of...
|
by: Leszek |
last post by:
Hi.
Is it possible in javascript to operate on an array without knowing how mamy
elements it has?
What i want to do is sending an array to a script, and this script should
add all values from...
|
by: Jim Carlock |
last post by:
Looking for suggestions on how to handle bad words that might
get passed in through $_GET variables.
My first thoughts included using str_replace() to strip out such
content, but then one ends...
|
by: =?Utf-8?B?U2hhcm9u?= |
last post by:
Hi Gurus,
I need to transfer a jagged array of byte by reference to unmanaged
function, The unmanaged code should changed the values of the array, and when
the unmanaged function returns I need...
|
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: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |