Be a Supporter!

Stripping Characters in Java

  • 390 Views
  • 1 Reply
New Topic Respond to this Topic
Jams44
Jams44
  • Member since: Nov. 8, 2004
  • Offline.
Forum Stats
Member
Level 07
Blank Slate
Stripping Characters in Java 2006-11-16 23:18:22 Reply

Quick Java question. So I am trying to compare two names. However, when the user inputs the name and accidentally puts a "space" at the end, the character literal will be recorded and thus won't equal the equivalent name without the "space". So I am wondering, is there some sort of strip function so I could remove all spaces? Thanks.

-Joe

0x41
0x41
  • Member since: Dec. 30, 2004
  • Offline.
Forum Stats
Member
Level 10
Blank Slate
Response to Stripping Characters in Java 2006-11-16 23:44:03 Reply

http://java.sun.com/j2se/1.3/docs/api/java/la ng/String.html#trim()