Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need to store space and enter in database

 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am working in forum site where i need to enter space and enter in database . how i make that possible ? . example:- Same as www.coderanch.com
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless and until you trim spaces yourself, database should store spaces and enter by default.
 
Ramesh Sengani
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried but it's not storing. Is that any charecter for space and enter ?
 
Piyush Mangal
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you sure there is no java script which is trimming the value? What do you get on server when you submit the form with spaces?
 
Bart Hofma
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cant you just store the ASCII values?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64828
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Space s are not different from any other character when it comes to strings and how databases store them. You don't need to to do anything special. if the spaces are being removed, then there is something in the code that doing it. You'll need to track down and find it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic