Click here to Skip to main content
14,699,879 members
Please Sign up or sign in to vote.
2.65/5 (3 votes)
See more:
// hey guys pls I need your help with this 

String EmailAdresses = AstraProperties.getProperties(AstraProperties.EMAIL_NOTIFICATIONS);


// when I print out EmailAdresses, it returns a long string of addresses
//jamesb@live.com,jbrowm@yahoo.com,cmsw@msn.com
// then I want to split it and place it in EmailArray


String[] EmailArrray = EmailAdresses.Split(",")

// but I get the error: Cannot implicitly convert type 'string' to 'string[]' 


// thanks for the help
Posted
Updated 3-Sep-20 11:23am
v3

Try:
String[] EmailArrray = EmailAdresses.Split(',');
   
Comments
Ron Beyer 16-Aug-13 12:43pm
   
Beat me by just a bit, +5 for same conclusion :)
Thomas Daniels 16-Aug-13 12:44pm
   
Thank you!
rudolph098 16-Aug-13 12:44pm
   
thanks
Thomas Daniels 16-Aug-13 12:46pm
   
You're welcome!
ridoy 16-Aug-13 13:30pm
   
i give you both a 5!
Thomas Daniels 16-Aug-13 13:42pm
   
Thank you!
String[] EmailArray = EmailAdresses.Split(',');


Problem is you are trying to use the wrong overload of the split function.
   
Comments
Thomas Daniels 16-Aug-13 12:44pm
   
+5!
rudolph098 16-Aug-13 12:44pm
   
thanks
ridoy 16-Aug-13 13:30pm
   
i give you both a 5!
Ron Beyer 16-Aug-13 13:52pm
   
Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900