473,322 Members | 1,562 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,322 software developers and data experts.

String array (String[]) being seen as System.Array

hi, im having a small issue. I pass a String[] object to a method, but then
when i try to use the Split method of a String array, it says System.Array
does not contain Split. The parameter of my method is a String array, so it
should be able to find the Split method. before i moved it into a new method,
it worked fine. why is this happening and what can i do? thanks
private Mail ParseMail(String[] st)
{

//create a new mail object
Mail m = new Mail();

//split the message into the parts (ex size, from, subject, etc)
ERROR HERE
String[] s = str.Split(new String[] { MESSAGE_PARTS_DELIMITER },
StringSplitOptions.RemoveEmptyEntries);

//iterate the array of parts
for (int i = 0; i < s.Length; i++)
{

//other code here

}

//return message
return m;

}
--
-iwdu15
Jun 11 '07 #1
4 4056
What is 'str' in your program? Is it a string?

"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:83**********************************@microsof t.com...
hi, im having a small issue. I pass a String[] object to a method, but
then
when i try to use the Split method of a String array, it says System.Array
does not contain Split. The parameter of my method is a String array, so
it
should be able to find the Split method. before i moved it into a new
method,
it worked fine. why is this happening and what can i do? thanks
private Mail ParseMail(String[] st)
{

//create a new mail object
Mail m = new Mail();

//split the message into the parts (ex size, from, subject,
etc)
ERROR HERE
String[] s = str.Split(new String[] {
MESSAGE_PARTS_DELIMITER },
StringSplitOptions.RemoveEmptyEntries);

//iterate the array of parts
for (int i = 0; i < s.Length; i++)
{

//other code here

}

//return message
return m;

}
--
-iwdu15

Jun 11 '07 #2
What is 'str' in your program? Is it a string?

sorry about that, typo on my part, the proper method declaration is this:

private Mail ParseMail(String[] str)

i forgot to put the 'r' in my parameter when i pasted that in....its in my
original source code though...
--
-iwdu15
Jun 11 '07 #3
String[] doesn't have a Split method - what makes you think it does?

Doug Forster

"iwdu15" <jmmgoalsteratyahoodotcomwrote in message
news:6B**********************************@microsof t.com...
>What is 'str' in your program? Is it a string?

sorry about that, typo on my part, the proper method declaration is this:

private Mail ParseMail(String[] str)

i forgot to put the 'r' in my parameter when i pasted that in....its in my
original source code though...
--
-iwdu15

Jun 11 '07 #4
wow.....major oversight on my part.....String does, not String[].....my bad,
i apologize, read my own code wrong.....thanks
--
-iwdu15
Jun 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

27
by: Trep | last post by:
Hi there! I've been having a lot of difficult trying to figure out a way to convert a terminated char array to a system::string for use in Visual C++ .NET 2003. This is necessary because I...
4
by: Chris | last post by:
I am calling a COM object that returns a type Object and it contains two strings but I can't get them out. Here is the command: object ParamNameObj= localxPCCOMOBJ.xPCTarget.GetParamName (1); ...
4
by: Dennis Myrén | last post by:
Hi. Is there a way to utilize the great primitive data type formatting routines available in .NET without working with strings? I want a byte directly rather than a string. I think it is...
5
by: AC [MVP MCMS] | last post by:
Any pointers on how to (1) read a Base64 encoded string from a text file and (2) write it to a binary file? I have a ton of files that are being generated from a legacy system. Each file...
4
by: jemptymethod | last post by:
http://htmatters.net/htm/1/2006/01/EIBTI-for-Javascript-explicit-is-better-than-implicit.cfm
7
by: james | last post by:
Hi, I am trying to insert a record into a database table, one field of which is a byte array. Using the below: Byte imgArr; .... <code to put image into imgArr>
4
by: BA | last post by:
Hello, I have a very strange code behavior that I cannot make heads or tails of: I have c# code being executed in BizTalk assemblies which is acting very strangely. In my BizTalk process I...
22
by: j1mb0jay | last post by:
I have had to create a simple string encryption program for coursework, I have completed the task and now have to do a write up on how it could be improved at a later date. If you could look...
13
by: Eps | last post by:
Hi there, I believe all strings in .net are unicode by default, I am looking for a way to remove all non ascii characters from a string (or optionally replace them). There is an article on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.