Solved

Trim a space from a string

Posted on 2002-03-21
2
189 Views
Last Modified: 2010-04-01
I'm looking for the best way to trim a spaces from a variable.  Like Trim()!
0
Comment
Question by:khagen
  • 2
2 Comments
 
LVL 33

Expert Comment

by:knightEknight
ID: 6886125
String str = "  hi  there   ";
String str2 = str.trim();
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 20 total points
ID: 6886129
or,

<%=str.trim()%>
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
html form inside div 3 91
IE doesn't Invoke servlet in iframe 1 101
maven j2ee examles 2 49
mask rule in struts validation.xml 5 85
In the hope of saving someone else's sanity... About a year ago we bought a Cisco 1921 router with two ADSL/VDSL EHWIC cards to load balance local network traffic over the two broadband lines we have, but we couldn't get the routing to work consi…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now