![]() |
array function, error in arrays.
Hey, I'm having trouble with a function, I want it to return all strings that have "Style: " at the beggining, they should return in an array. At first I was having errors because the array wasn't assigned, I assigned a null value but got another error lol. I tried the "ArrayList" too but couldnt get that to return properly. Also in msdn it said IndexOf will return 1 if the string is in, 0 if it is null, but mine returns 0 for all lines with "Style: ", A left() function would probably be better for me with this, as it will always be in the same place, else its invalid, but i couldnt find one :(. Heres the code:
:
public string[] setstyles()Please help thanks! ~(^O^~) |
nvm solved :)
just used a normal string and split. |
In the event that you ever need to use arrays again, you were trying to assgin values to stylearray when it is null. You need to give it a size first, likely based on how much you need to store.
|
| All times are GMT -5. The time now is 2:04 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC