String.Split and String.ToArray: is one better than the other?

I’m currently modifying one relatively big project to API 2 (a lot of work and spent time for no great benefit other than staying up to date, by the way).
The Split() function is deprecated. However, there are two 2.0 available replacements (String.Split() and String.Join()). Even in their documentation in the LR, I can’t find a single different parameter, usage or word of explanation between the two (to me, they are exactly the same).
I don’t want to choose the wrong one (either because one is newer, thus preferable than the other, or because one of them is going to be removed, say, next year and I’d have to change again).
Is there any difference, even slightly, between the two?
(I’m not speaking about a preference of terminology, of course)

I haven’t tested but a difference might be that Split( “” ) gives you code points while ToArray( “” ) gives you characters that might be made up of more than one code point, for example e + &u0300, representing the decomposed “é” (or something). Split will return that as two elements for sure.

But I haven’t tested that.

String.Split and String.ToArray work exactly the same.

1 Like

Good guess; how did you came to this possibility? (even if it’s actually not true)

Thanks. Any way to know which one could become deprecated first so we choose the correct one?

Splitting by true characters is what the Characters iterator does. Or, is supposed to do.

1 Like