Quote:
Originally Posted by Gunderak
PHP Code:
temp.lname = player.level.name.substring(6);
temp.lname = lname.substring(0, lname.pos(".nw").trim());
//had to use it twice, I tried player.level.name.substring(6, lname.pos(".nw").trim()); with no luck.
|
That's because the second parameter is the length to cut, not the index of the last character to cut.
PHP Code:
temp.account = player.level.name.substring(6, player.level.name.length() - 9);
That should work.
Why are you trimming the position of ".nw"? It doesn't make any sense to trim output from a function which always returns integers.