Tuesday, 23 July 2013

Storing text in an array splitting by whitespace (C#)

If you have a string and you wish to store individual words from that string in an array split by whitespace then. Using c#:

string[] ssize = myStr.Split(null)
The split method assumes whitespace to be the splitting character when you specify null and you now have an array of string with each word from the original text.

No comments:

Post a Comment