Is ; a good string parser delimiter ?
Printable View
Is ; a good string parser delimiter ?
I think it depends on what your string will be. If you create the string yourself, you may use this delimiter and avoid the ";". If someone else creates the string, I think you'd rather use "|".
If there aren't any semicolons in the strings you want to delimit, yes.
Surmulot is right. If this delimiter is used in strings with player-input, then ";" might be used... But "|" could be used too (in smileys for example :|).
I currently use "|" much, but i make tests to avoid this kind of problem, and I try to use player-input at the end of the tokenized string, so that it won't matter much :
/PrivateMessage|Corentin|Rushino| hey :| Here's my private message to you Rushino
will not result in a big problem.
/PrivateMessage|hey :| Here's my private message to you Rushino|Corentin|Rushino
Would be more complicated....
Remember that client-side tests aren't enough, a hacker could send text containing your delimiter without using your client, but with another app
They could also send it using your client with a tool like WPE, no matter how much protection you put in client side.
Interesting... how about * ? that will never be used...
I am using the #. :)
I use stuff like ±.
I use "¤" because this character is never used.
and using a combination of odd characters (i.e. "|+") would increase the odds that someone would use them.
I use the XP Password Character/Bullet point.
Basically, anything that you can't access directly with the keyboard is probably your best bet.
Hold down the left "alt" and type in on the keypad:Quote:
Basically, anything that you can't access directly with the keyboard is probably your best bet.
"0149" or
"0177"
:) you can access everything :)
Obviously, but anything accessible by that has to be better than ;.
The alternative is to do what mmf2 did and use commas but put text into ""s. Of course you couldn't use string parser for this but it is not hard to make your own parser which detects whether there is an odd number of "s before the comma or not... :D