View Single Post
Old Apr 6th, 2007, 8:50 AM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Quote:
Originally Posted by Infinite Recursion View Post
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote