File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

white spaces is not trim if shift +space+space+space+space is being press on textarea help thanks

 
chrstian ferma
Ranch Hand
Posts: 72
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day here's the sample input

valid.

test1
"1 line space"
test1
output:
test1

test1


Invalid

test1
"enter"
"shift+space+space+space+space" test1
output:
test1

"shift+space+space+space"test1 doesnt trim the shift space space space space

but if you not pressing the shift space space space space just enter and space space without holding the shift it will trim the spaces the only allowing 1 line space and trims white spaces , scenario it's not trimming the spaces it you press shift +space+space+space+space+space thank you
 
Paul Clapham
Sheriff
Pie
Posts: 20156
23
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This "textarea" is a JTextArea? (You posted in the Swing etc. forum so I assume that's what you meant.) If so then I don't understand the question because a JTextArea doesn't trim any whitespace.
 
chrstian ferma
Ranch Hand
Posts: 72
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you this one is already solved
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what was the solution? I don't think shift‑space counts as whitespace.
 
chrstian ferma
Ranch Hand
Posts: 72
Eclipse IDE Java Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the solution that i found was not related on my post , i change the regular expression that im using and then it solves
 
Campbell Ritchie
Sheriff
Pie
Posts: 47216
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for telling us.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic