Delimiting user input
What is the best character to restrict user input?
For example, if a user has an infinite number of text fields to type in, but each text field value will be concatenated into one database field, what is the safest character to delimit each input?
I think it must be a character not on your typical keyboard. Is there a character just for that?
a source to share
You can use one of the ASCII control characters. There's one called "Record Separator" which has a hexadecimal value of 0x1E which might suit your needs.
Edit . By the way, if you want to do the right job, you should probably make sure that \ x1E is escaped into user input. One way to do this is to use another ASCII escape character: \ x1B, which is the "escape" escape code. Thus, "\ x1E" becomes "\ x1B \ x1E" in the input, and "\ x1B" becomes "\ x1B \ x1B".
Keep in mind, of course, that since these are non-printable control codes, they cannot be displayed. If you want to print the view, you can go with a normal character like a comma and just avoid typing it.
a source to share
I am guessing one approach is to use a comma and then remove the commas inside the user input. It is probably unsafe to assume that any character (or even a sequence of characters) cannot appear in user input - if you can enter it in your code, that is the way the user can enter it in a text field!
a source to share