Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iwdu15 - 11 Jun 2007 23:01 GMT
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;

       }
Signature

-iwdu15

Michael A. Covington - 11 Jun 2007 23:17 GMT
What is 'str' in your program?  Is it a string?

> hi, im having a small issue. I pass a String[] object to a method, but
> then
[quoted text clipped - 30 lines]
>
>        }
iwdu15 - 11 Jun 2007 23:25 GMT
> 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...
Signature

-iwdu15

Doug Forster - 11 Jun 2007 23:39 GMT
String[] doesn't have a Split method - what makes you think it does?

Doug Forster

>> What is 'str' in your program?  Is it a string?
>
[quoted text clipped - 4 lines]
> i forgot to put the 'r' in my parameter when i pasted that in....its in my
> original source code though...
iwdu15 - 11 Jun 2007 23:47 GMT
wow.....major oversight on my part.....String does, not String[].....my bad,
i apologize, read my own code wrong.....thanks
Signature

-iwdu15


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.