is string \
#1

Hi,

HOw to check is string \ ?
Reply
#2

You want to check if player type "\" ??
Reply
#3

No.

I have string like that

new string[ 50 ] = "\n";

and i need if in specific array slot

if( string[ 0 ] == "\\")
{

}

but that not work
Reply
#4

Every "slot" of string can contain only a single character

if(string[0] == '/' && string[1] == '/')
//Do something
Reply
#5

If you want to check a single character then you need to use single quotes, not double quotes.
Reply
#6

Code:
new string[64];
for(new i=0;i++;i<sizeof(string))
{
    if(string[i]=='\' && string[i+1]=='n')
   {
    //your function
   }

}
i guess this is what you're asking for
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)