S
Sky
Hi. Coming from PHP where all things are strings, the char is a bit hard to
get used to.
So far, I'm not really sure what the dif/use is between a string and a
char[] array...except notation, and the fact that most functions I expect to
use a string with, expect a char, or char array...
Specifically, I am now looking at the String.Split function that has to be
called as
string[] o = "The,Cat,Sleeps".split(",".ToCharArray());
What I am not sure about is Why it has to be converted to a char array. Most
languages I know you give it another string to split by, not a char array...
Is there a split function that accepts a string, btw?
I'm asking, not grumbling, to try to get a good handle on understanding the
reason why chars are more efficient, etc. and why to "love" em rather than
'hate' em. So far seem to get in the way rather than help.
Any pointers/frame of mind that anybody has to offer?
Thanks,
Sky
get used to.
So far, I'm not really sure what the dif/use is between a string and a
char[] array...except notation, and the fact that most functions I expect to
use a string with, expect a char, or char array...
Specifically, I am now looking at the String.Split function that has to be
called as
string[] o = "The,Cat,Sleeps".split(",".ToCharArray());
What I am not sure about is Why it has to be converted to a char array. Most
languages I know you give it another string to split by, not a char array...
Is there a split function that accepts a string, btw?
I'm asking, not grumbling, to try to get a good handle on understanding the
reason why chars are more efficient, etc. and why to "love" em rather than
'hate' em. So far seem to get in the way rather than help.
Any pointers/frame of mind that anybody has to offer?
Thanks,
Sky