Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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
  • 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
Posts: 21319
32
Eclipse IDE Firefox Browser MySQL Database
  • 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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you this one is already solved
 
Campbell Ritchie
Sheriff
Pie
Posts: 49783
69
  • 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
  • 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: 49783
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for telling us.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic