Posts: 723
Threads: 366
Joined: Jun 2016
Hi,
If i strdel string, and use strlenght that string lenght it's not crash server, or player client?
strdel(string,0,strlen(string) );
Posts: 944
Threads: 128
Joined: Sep 2014
Reputation:
0
What about you hop in-game and test it?
Posts: 723
Threads: 366
Joined: Jun 2016
I don't get crash, but i mean it's safe use for everytime?
Posts: 383
Threads: 70
Joined: Feb 2016
Why would it crash lol , the strdel - deletes a part of string.
Posts: 723
Threads: 366
Joined: Jun 2016
But if i want to del, all string to end, i have to use strlen(string) or strlen(string)-1 ?
Posts: 484
Threads: 11
Joined: Oct 2012
Reputation:
0
You have to use strlen only. No need to subtract 1. It's safe.
Posts: 4,759
Threads: 33
Joined: Dec 2013
Reputation:
0
Use strdel only if you want to delete a part of a string, or equal the last index that is going to be used to EOS (End Of String).
If you want to empty a string, equal the first index (index 0) to EOS.