How to check if a string contains spaces?
#6

Quote:
Originally Posted by Universal
View Post
Yes, use this:

pawn Code:
strfind(string, " ")
This will return true if it contains spaces, false if not.
Wrong, wrong, wrong. Read this before posting.

To see if the newName contains a space, use this:
pawn Code:
if(strfind(newName, " ") != -1)
{
    // yes, it does
}
Reply


Messages In This Thread
How to check if a string contains spaces? - by Superthijs - 04.02.2012, 11:03
Re: How to check if a string contains spaces? - by Universal - 04.02.2012, 11:05
Re: How to check if a string contains spaces? - by [XST]O_x - 04.02.2012, 11:05
Re: How to check if a string contains spaces? - by Superthijs - 04.02.2012, 11:09
Re: How to check if a string contains spaces? - by Superthijs - 04.02.2012, 11:12
Re: How to check if a string contains spaces? - by AndreT - 04.02.2012, 11:14
Re: How to check if a string contains spaces? - by [XST]O_x - 04.02.2012, 11:15
Re: How to check if a string contains spaces? - by Superthijs - 04.02.2012, 11:15

Forum Jump:


Users browsing this thread: 2 Guest(s)