Hello,
Could someone tell me how to create an array of strings?
Thanks,
Miguel 4 1628
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: 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,...
|
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$) {
}
...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |