I have textbox in c#, contains two or three strings with white spaces. i want to store those strings seperately.please, suggest me any code. thanx.
Calling String.Split() with no parameters will force the method to consume all whitespace and only return the separated strings:
var individualStrings = originalString.Split();
Try this:
string str = @"this is my string"; string[] arr = str.Split(new char[] { char.Parse(" ") });