Suppose that there are textbox First name and Last Name. Should we trim it before entering it into database For example

First name "John      " -> trim to "John"

Last name  "Lennon  " -> trim to "Lennon"

closed as off topic by Schroedingers Cat, Roger Attrill, ChrisF, JonW May 17 '12 at 8:57

Questions on User Experience Stack Exchange are expected to relate to user experience within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    I am not convinced this is really UX? The answer is yes, but not for UX reasons. – Schroedingers Cat May 17 '12 at 8:01
  • should it on stackoverflow ? – Sarawut Positwinyu May 17 '12 at 8:02
  • @SarawutPositwinyu - not really. The answer is probably "yes", but there may be cases where you don't want to trim. – ChrisF May 17 '12 at 8:20
  • @SarawutPositwinyu StackOverflow would be better IMO. But it might depend why you are asking. – Schroedingers Cat May 17 '12 at 8:27
  • 1
    This is off-topic for UX.SE and isn't detailed enough to be migrated over to StackOverflow so it's been closed off here. – JonW May 17 '12 at 8:57

Absolutely...always trim data before storing it. (P.S. This question really belongs on StackOverflow rather than here)

Not the answer you're looking for? Browse other questions tagged or ask your own question.