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

G

Guest

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;

}
 
G

Guest

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...
 
D

Doug Forster

String[] doesn't have a Split method - what makes you think it does?

Doug Forster

iwdu15 said:
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...
 
G

Guest

wow.....major oversight on my part.....String does, not String[].....my bad,
i apologize, read my own code wrong.....thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top