03.12.2017, 04:14
You could do something like this:
Watch out, if the name contains spaces or if there are more than two space characters the script above might not work!
PHP код:
// OnDialogResponse
if(response)
{
ClearName(inputtext);
// Now "inputtext" contains the name only.
}
ClearName(inputtext[])
{
// Removes everything until the 1st found space.
for(new x = 0, len = strlen(inputtext); x < len; x++)
{
if(inputtext[x] == ' ')
{
strdel(inputtext, 0, x + 1);
break;
}
}
// Removes everything after the 2nd found space.
for(new x = 0, len = strlen(inputtext); x < len; x++)
{
if(inputtext[x] == ' ')
{
strdel(inputtext, x, len);
}
}
}