Quote:
Originally Posted by Infinite Recursion
Use the IndexOf() function...
int pos = clientInfo.IndexOf(" ");
if (pos > 0)
Console.WriteLine("Space in the string.");
else
Console.WriteLine("NO space in the string.");
|
You'll want to check if pos is greater than
or equal to 0 - a space can be the first character in a string too. If there is no space, the function will return -1.