Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Swing / AWT / SWT and the fly likes white spaces is not trim if shift +space+space+space+space is being press on textarea help thanks Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "white spaces is not trim if shift +space+space+space+space is being press on textarea help thanks " Watch "white spaces is not trim if shift +space+space+space+space is being press on textarea help thanks " New topic
Author

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

chrstian ferma
Ranch Hand

Joined: Mar 26, 2014
Posts: 56

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
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Mar 26, 2014
Posts: 56

thank you this one is already solved
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37907
    
  22
And what was the solution? I don't think shift‑space counts as whitespace.
chrstian ferma
Ranch Hand

Joined: Mar 26, 2014
Posts: 56

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

Joined: Oct 13, 2005
Posts: 37907
    
  22
Thank you for telling us.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: white spaces is not trim if shift +space+space+space+space is being press on textarea help thanks
 
Similar Threads
byte to String conversion
Two key bindings for a single button
Saving word document in browser doesn't work
assign faculty members to classes
Regex to search a string