username splitting sscanf
#9

Quote:
Originally Posted by ThePhenix
Посмотреть сообщение
You could so something like this:

PHP код:
new input_string[]  =     "@TestName#848913";
    new 
username[64];
    new 
discriminator;
    new 
len strlen(input_string);
    for(new 
leni--; )
    {
        if(
input_string[i] == '#')
        {
            
input_string[i] = ' ';
            break;
        }
    }
    if(!
sscanf(input_string"'@'s[64]d"username,discriminator))
    {
        
//do something with username and discriminator
        
printf("Username: %s | Discriminator: %d "usernamediscriminator);
    } 
Outputs:

Код:
Username: TestName | Discriminator: 848913
What if the name is hello121312312 and the disc. is 9999?


mhm.
Reply


Messages In This Thread
username splitting sscanf - by Zorono - 24.11.2017, 11:17
Re: username splitting sscanf - by pollo97 - 24.11.2017, 13:24
Re: username splitting sscanf - by Zorono - 24.11.2017, 13:56
Re: username splitting sscanf - by SyS - 24.11.2017, 14:05
Re: username splitting sscanf - by Zorono - 24.11.2017, 14:35
Re: username splitting sscanf - by SyS - 24.11.2017, 14:48
Re: username splitting sscanf - by GhostHacker9 - 24.11.2017, 14:53
Re: username splitting sscanf - by ThePhenix - 24.11.2017, 15:45
Re: username splitting sscanf - by Meller - 24.11.2017, 15:49
Re: username splitting sscanf - by Zorono - 25.11.2017, 08:06

Forum Jump:


Users browsing this thread: 1 Guest(s)